unc_003::update_data()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 26
rs 9.7666
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 *
4
 * User Notification Control [UNC]. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2020-forever, Dark❶, https://dark1.tech
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace dark1\usernotificationcontrol\migrations;
12
13
/**
14
 * @ignore
15
 */
16
use phpbb\db\migration\migration;
17
18
/**
19
 * Migration stage 003 : Add Module & Config
20
 */
21
class unc_003 extends migration
22
{
23
	static public function depends_on()
24
	{
25
		return ['\dark1\usernotificationcontrol\migrations\unc_002'];
26
	}
27
28
	public function update_data()
29
	{
30
		return [
31
			// Add Config
32
			['config.add', ['dark1_unc_all_notify_expire_days', 365, true]],
33
			['config.add', ['dark1_unc_auto_prune_notify_enable', 0, true]],
34
			['config.add', ['dark1_unc_auto_prune_notify_gc', 864000, true]],
35
			['config.add', ['dark1_unc_auto_prune_notify_last_gc', 0, true]],
36
37
			// Remove Module
38
			['module.remove', [
39
				'acp',
40
				'ACP_UNC_TITLE',
41
				[
42
					'module_basename'	=> '\dark1\usernotificationcontrol\acp\main_module',
43
					'modes'				=> ['main'],
44
				],
45
			]],
46
47
			// Add Module
48
			['module.add', [
49
				'acp',
50
				'ACP_UNC_TITLE',
51
				[
52
					'module_basename'	=> '\dark1\usernotificationcontrol\acp\main_module',
53
					'modes'				=> ['main', 'prune'],
54
				],
55
			]],
56
		];
57
	}
58
}
59