Completed
Pull Request — develop-stable (#74)
by Paul
05:01 queued 01:19
created

remove_push_config::update_data()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 12
rs 9.4286
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
/**
3
 *
4
 * Ajax Shoutbox extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2014 Paul Sohier <http://www.ajax-shoutbox.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
namespace paul999\ajaxshoutbox\migrations;
11
12
class remove_push_config extends \phpbb\db\migration\migration
13
{
14
	static public function depends_on()
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
15
	{
16
		return array(
17
			'\paul999\ajaxshoutbox\migrations\add_push_config',
18
			'\paul999\ajaxshoutbox\migrations\add_push_config2',
19
			'\paul999\ajaxshoutbox\migrations\update_push_config'
20
		);
21
	}
22
23
	public function revert_data()
24
	{
25
		return array(
26
			array('config.add', array('ajaxshoutbox_validation_id', uniqid())),
27
			array('config.add', array('ajaxshoutbox_push_enabled', false)),
28
			array('config.add', array('ajaxshoutbox_api_key', '')),
29
			array('config.add', array('ajaxshoutbox_connection_key', '')),
30
31
			array('config.add', array('ajaxshoutbox_api_server', 'https://www.shoutbox-app.com/post')), // We can't use the API.
32
			array('config.add', array('ajaxshoutbox_ssl_key', '')),
33
		);
34
	}
35
36
	public function update_data()
37
	{
38
		return array(
39
			array('config.remove', array('ajaxshoutbox_validation_id')),
40
			array('config.remove', array('ajaxshoutbox_push_enabled')),
41
			array('config.remove', array('ajaxshoutbox_api_key')),
42
			array('config.remove', array('ajaxshoutbox_connection_key')),
43
44
			array('config.remove', array('ajaxshoutbox_api_server')),
45
			array('config.remove', array('ajaxshoutbox_ssl_key')),
46
		);
47
	}
48
}
49