aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2020-01-01 11:22:03 +0100
committerMarc Alexander <admin@m-a-styles.de>2020-01-01 11:22:03 +0100
commit6c0137c7a3b324f98648b48454c88ae389ca9740 (patch)
treed12859948d1b393391bf040ed7c4b3240c1e75b0
parent[ticket/16284] Add migration for 4.0.0-dev (diff)
downloadphpbb-6c0137c7a3b324f98648b48454c88ae389ca9740.tar.gz
phpbb-6c0137c7a3b324f98648b48454c88ae389ca9740.tar.bz2
phpbb-6c0137c7a3b324f98648b48454c88ae389ca9740.zip
[ticket/16284] Add effectively_installed check to acp_storage_module
PHPBB3-16284
-rw-r--r--phpBB/phpbb/db/migration/data/v400/acp_storage_module.php38
1 files changed, 30 insertions, 8 deletions
diff --git a/phpBB/phpbb/db/migration/data/v400/acp_storage_module.php b/phpBB/phpbb/db/migration/data/v400/acp_storage_module.php
index d5491a625e..daa17e2955 100644
--- a/phpBB/phpbb/db/migration/data/v400/acp_storage_module.php
+++ b/phpBB/phpbb/db/migration/data/v400/acp_storage_module.php
@@ -11,23 +11,45 @@
*
*/
-namespace phpbb\db\migration\data\v330;
+namespace phpbb\db\migration\data\v400;
-class acp_storage_module extends \phpbb\db\migration\migration
+use phpbb\db\migration\migration;
+
+class acp_storage_module extends migration
{
+ public function effectively_installed()
+ {
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'acp'
+ AND module_langname = 'ACP_STORAGE_SETTINGS'";
+ $result = $this->db->sql_query($sql);
+ $acp_storage_module_id = (int) $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+
+ return !empty($acp_storage_module_id);
+ }
+
+ static public function depends_on()
+ {
+ return [
+ '\phpbb\db\migration\data\v400\dev',
+ ];
+ }
+
public function update_data()
{
- return array(
- array('module.add', array(
+ return [
+ ['module.add', [
'acp',
'ACP_SERVER_CONFIGURATION',
- array(
+ [
'module_basename' => 'acp_storage',
'module_langname' => 'ACP_STORAGE_SETTINGS',
'module_mode' => 'settings',
'module_auth' => 'acl_a_storage',
- ),
- )),
- );
+ ],
+ ]],
+ ];
}
}