ext::is_enableable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
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;
12
13
/**
14
 * @ignore
15
 */
16
use phpbb\extension\base;
17
18
/**
19
 * Reduce Search Index Extension base
20
 */
21
class ext extends base
22
{
23
	/** @var string Require phpBB v3.2.3 due to phpBB core events. */
24
	const PHPBB_MIN_3_2_X = '3.2.3';
25
26
	/**
27
	 * {@inheritdoc}
28
	 */
29
	public function is_enableable()
30
	{
31
		return $this->pbpbb_ver_chk();
32
	}
33
34
	/**
35
	 * phpBB Version Check.
36
	 *
37
	 * @return bool
38
	 * @access private
39
	 */
40
	private function pbpbb_ver_chk()
41
	{
42
		$config = $this->container->get('config');
43
44
		$phpbb_version = phpbb_version_compare(PHPBB_VERSION, $config['version'], '>=') ? PHPBB_VERSION : $config['version'] ;
45
46
		return phpbb_version_compare($phpbb_version, self::PHPBB_MIN_3_2_X, '>=');
47
	}
48
}
49