1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* |
4
|
|
|
* Precise Similar Topics |
5
|
|
|
* |
6
|
|
|
* @copyright (c) 2013 Matt Friedman |
7
|
|
|
* @license GNU General Public License, version 2 (GPL-2.0) |
8
|
|
|
* |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace vse\similartopics\migrations; |
12
|
|
|
|
13
|
|
|
class release_1_3_0_data extends \phpbb\db\migration\migration |
14
|
|
|
{ |
15
|
|
|
public function effectively_installed() |
16
|
|
|
{ |
17
|
|
|
return isset($this->config['similar_topics_version']) && version_compare($this->config['similar_topics_version'], '1.3.0', '>='); |
18
|
|
|
} |
19
|
|
|
|
20
|
|
|
static public function depends_on() |
21
|
|
|
{ |
22
|
|
|
return array('\vse\similartopics\migrations\release_1_3_0_schema'); |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
public function update_data() |
26
|
|
|
{ |
27
|
|
|
return array( |
28
|
|
|
// remove old ACP module if it exists |
29
|
|
|
array('if', array( |
30
|
|
|
array('module.exists', array('acp', 'PST_TITLE_ACP', 'PST_TITLE')), |
31
|
|
|
array('module.remove', array('acp', 'PST_TITLE_ACP', 'PST_TITLE')), |
32
|
|
|
)), |
33
|
|
|
array('if', array( |
34
|
|
|
array('module.exists', array('acp', 'PST_TITLE_ACP', 'PST_SETTINGS')), |
35
|
|
|
array('module.remove', array('acp', 'PST_TITLE_ACP', 'PST_SETTINGS')), |
36
|
|
|
)), |
37
|
|
|
// add new ACP module |
38
|
|
|
array('module.add', array( |
39
|
|
|
'acp', 'PST_TITLE_ACP', array( |
40
|
|
|
'module_basename' => '\vse\similartopics\acp\similar_topics_module', |
41
|
|
|
'modes' => array('settings'), |
42
|
|
|
), |
43
|
|
|
)), |
44
|
|
|
// Update existing configs |
45
|
|
|
array('config.update', array('similar_topics_version', '1.3.0')), |
46
|
|
|
); |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|