mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 20:38:52 +00:00
[ticket/16284] Add effectively_installed check to acp_storage_module
PHPBB3-16284
This commit is contained in:
parent
d15d75e2ba
commit
6c0137c7a3
1 changed files with 30 additions and 8 deletions
|
@ -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()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return [
|
||||||
array('module.add', array(
|
['module.add', [
|
||||||
'acp',
|
'acp',
|
||||||
'ACP_SERVER_CONFIGURATION',
|
'ACP_SERVER_CONFIGURATION',
|
||||||
array(
|
[
|
||||||
'module_basename' => 'acp_storage',
|
'module_basename' => 'acp_storage',
|
||||||
'module_langname' => 'ACP_STORAGE_SETTINGS',
|
'module_langname' => 'ACP_STORAGE_SETTINGS',
|
||||||
'module_mode' => 'settings',
|
'module_mode' => 'settings',
|
||||||
'module_auth' => 'acl_a_storage',
|
'module_auth' => 'acl_a_storage',
|
||||||
),
|
],
|
||||||
)),
|
]],
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue