Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 22
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
acp_storage_module
0.00% covered (danger)
0.00%
0 / 22
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 effectively_installed
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
2
 depends_on
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 update_data
0.00% covered (danger)
0.00%
0 / 12
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3*
4* This file is part of the phpBB Forum Software package.
5*
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
7* @license GNU General Public License, version 2 (GPL-2.0)
8*
9* For full copyright and license information, please see
10* the docs/CREDITS.txt file.
11*
12*/
13
14namespace phpbb\db\migration\data\v400;
15
16use phpbb\db\migration\migration;
17
18class acp_storage_module extends migration
19{
20    public function effectively_installed()
21    {
22        $sql = 'SELECT module_id
23            FROM ' . $this->tables['modules'] . "
24            WHERE module_class = 'acp'
25                AND module_langname = 'ACP_STORAGE_SETTINGS'";
26        $result = $this->db->sql_query($sql);
27        $acp_storage_module_id = (int) $this->db->sql_fetchfield('module_id');
28        $this->db->sql_freeresult($result);
29
30        return !empty($acp_storage_module_id);
31    }
32
33    public static function depends_on()
34    {
35        return [
36            '\phpbb\db\migration\data\v400\dev',
37        ];
38    }
39
40    public function update_data()
41    {
42        return [
43            ['module.add', [
44                'acp',
45                'ACP_SERVER_CONFIGURATION',
46                [
47                    'module_basename'    => 'acp_storage',
48                    'module_langname'    => 'ACP_STORAGE_SETTINGS',
49                    'module_mode'        => 'settings',
50                    'module_auth'        => 'acl_a_storage',
51                ],
52            ]],
53        ];
54    }
55}