v110_data   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 31
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A effectively_installed() 0 3 1
A update_data() 0 19 1
A depends_on() 0 3 1
1
<?php
2
/**
3
*
4
* @package		Breizh Smilies Categories Extension
5
* @copyright	(c) 2020-2024 Sylver35  https://breizhcode.com
6
* @license		https://opensource.org/licenses/gpl-license.php GNU Public License
7
*
8
*/
9
10
namespace sylver35\smiliescat\migrations;
11
12
use phpbb\db\migration\migration;
13
14
class v110_data extends migration
15
{
16
	public function effectively_installed()
17
	{
18
		return isset($this->config['smilies_per_page_cat']);
19
	}
20
21
	static public function depends_on()
22
	{
23
		return ['\sylver35\smiliescat\migrations\v110_schema'];
24
	}
25
26
	public function update_data()
27
	{
28
		return [
29
			// Config
30
			['config.add', ['smilies_category_nb', 0]],
31
			['config.add', ['smilies_per_page_cat', 15]],
32
33
			// Add ACP modules
34
			['module.add', ['acp', 'ACP_MESSAGES', [
35
				'module_basename'	=> '\sylver35\smiliescat\acp\main_module',
36
				'module_langname'	=> 'ACP_SC_SMILIES',
37
				'module_mode'		=> 'smilies',
38
				'module_auth'		=> 'ext_sylver35/smiliescat && acl_a_icons',
39
			]]],
40
			['module.add', ['acp', 'ACP_MESSAGES', [
41
				'module_basename'	=> '\sylver35\smiliescat\acp\main_module',
42
				'module_langname'	=> 'ACP_SC_CONFIG',
43
				'module_mode'		=> 'config',
44
				'module_auth'		=> 'ext_sylver35/smiliescat && acl_a_icons',
45
			]]],
46
		];
47
	}
48
}
49