rsi_000_main::update_data()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 16
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 23
rs 9.7333
1
<?php
2
/**
3
 *
4
 * Reduce Search Index [RSI]. 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\reducesearchindex\migrations;
12
13
/**
14
 * @ignore
15
 */
16
use phpbb\db\migration\migration;
17
18
/**
19
 * Migration stage 000 : Main
20
 */
21
class rsi_000_main extends migration
22
{
23
	static public function depends_on()
24
	{
25
		return ['\phpbb\db\migration\data\v320\v320'];
26
	}
27
28
	public function update_data()
29
	{
30
		return [
31
			// Config
32
			['config.add', ['dark1_rsi_enable', 0]],
33
			['config.add', ['dark1_rsi_time', 0, true]],
34
			['config.add', ['dark1_rsi_interval', 31536000, true]],
35
			['config.add', ['dark1_rsi_auto_reduce_sync_enable', 0, true]],
36
			['config.add', ['dark1_rsi_auto_reduce_sync_gc', 864000, true]],
37
			['config.add', ['dark1_rsi_auto_reduce_sync_last_gc', 0, true]],
38
39
			// Module
40
			['module.add', [
41
				'acp',
42
				'ACP_CAT_DOT_MODS',
43
				'ACP_RSI_TITLE',
44
			]],
45
			['module.add', [
46
				'acp',
47
				'ACP_RSI_TITLE',
48
				[
49
					'module_basename'	=> '\dark1\reducesearchindex\acp\main_module',
50
					'modes'				=> ['main', 'forum', 'cron'],
51
				],
52
			]],
53
		];
54
	}
55
}
56