Completed
Push — master ( 42e677...2a102b )
by Matt
18s queued 11s
created

m5_cache::effectively_installed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 *
4
 * phpBB Media Embed PlugIn extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2020 phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\mediaembed\migrations;
12
13
/**
14
 * Migration to install MediaEmbed cache and cron task data
15
 */
16
class m5_cache extends \phpbb\db\migration\migration
17
{
18
	public static function depends_on()
19
	{
20
		return ['\phpbb\mediaembed\migrations\m4_permissions'];
21
	}
22
23
	public function effectively_installed()
24
	{
25
		return isset($this->config['media_embed_enable_cache'], $this->config['mediaembed_last_gc']);
26
	}
27
28
	public function update_data()
29
	{
30
		return [
31
			['config.add', ['media_embed_enable_cache', 0]],
32
			['config.add', ['mediaembed_last_gc', 0, true]],
33
		];
34
	}
35
}
36