Completed
Push — master ( 2f47f6...1bc363 )
by Matt
02:34
created

release_2_0_0   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 32
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A effectively_installed() 0 4 1
A depends_on() 0 4 1
A update_data() 0 19 1
1
<?php
2
/**
3
*
4
* Topic Preview
5
*
6
* @copyright (c) 2013 Matt Friedman
7
* @license GNU General Public License, version 2 (GPL-2.0)
8
*
9
*/
10
11
namespace vse\topicpreview\migrations\v2xx;
12
13
class release_2_0_0 extends \phpbb\db\migration\migration
14
{
15
	public function effectively_installed()
16
	{
17
		return isset($this->config['topic_preview_avatars']);
18
	}
19
20
	static public function depends_on()
21
	{
22
		return array('\vse\topicpreview\migrations\v1xx\release_1_0_6_data');
23
	}
24
25
	public function update_data()
26
	{
27
		return array(
28
			// Add ACP module
29
			array('module.add', array('acp', 'ACP_CAT_DOT_MODS', 'TOPIC_PREVIEW')),
30
			array('module.add', array('acp', 'TOPIC_PREVIEW', array(
31
				'module_basename'	=> '\vse\topicpreview\acp\topic_preview_module',
32
				'modes'				=> array('settings'),
33
			))),
34
35
			// Add new configs
36
			array('config.add', array('topic_preview_last_post', '0')),
37
			array('config.add', array('topic_preview_avatars', '0')),
38
			array('config.add', array('topic_preview_jquery', '0')),
39
40
			// Update existing configs
41
			array('config.update', array('topic_preview_version', '2.0.0')),
42
		);
43
	}
44
}
45