1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-14 04:42:04 +02:00

[ticket/16284] Add effectively_installed check to acp_storage_module

PHPBB3-16284
This commit is contained in:
Marc Alexander 2020-01-01 11:22:03 +01:00
parent d15d75e2ba
commit 6c0137c7a3
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995

@ -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',
),
)),
);
],
]],
];
}
}