Completed
Push — master ( 66a618...08ac9c )
by Michael
03:47 queued 01:44
created

ext::s9e_textformatter_installed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 *
4
 * phpBB Media Embed PlugIn extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2016 phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\mediaembed;
12
13
class ext extends \phpbb\extension\base
14
{
15
	/**
16
	 * {@inheritDoc}
17
	 */
18
	public function is_enableable()
19
	{
20
		return $this->s9e_textformatter_installed() && !$this->s9e_mediamebed_installed();
21
	}
22
23
	/**
24
	 * Check if s9e TextFormatter is installed (it must be
25
	 * to enable this extension).
26
	 *
27
	 * @return bool
28
	 */
29
	public function s9e_textformatter_installed()
30
	{
31
		return class_exists('\s9e\TextFormatter\Configurator');
32
	}
33
34
	/**
35
	 * Check if s9e MediaEmbed extension for phpBB is installed
36
	 * (it must NOT be to enable this extension).
37
	 *
38
	 * @return bool
39
	 */
40
	public function s9e_mediamebed_installed()
41
	{
42
		return class_exists('\s9e\mediaembed\ext');
43
	}
44
}
45