-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathext.php
49 lines (42 loc) · 1.21 KB
/
ext.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
*
* Topics Hierarchy. An extension for the phpBB Forum Software package.
*
* @copyright (c) 2016 - 2017, 3Di, http://3di.space/32/
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
namespace threedi\topicshierarchy;
/**
* Topics Hierarchy Extension base
*/
class ext extends \phpbb\extension\base
{
/**
* Check whether the extension can be enabled.
* Provides meaningful(s) error message(s) and the back-link on failure.
* CLI and 3.1/3.2 compatible (we do not use the $lang object here on purpose)
*
* @return bool
*/
public function is_enableable()
{
$is_enableable = true;
$user = $this->container->get('user');
$user->add_lang_ext('threedi/topicshierarchy', 'ext_require');
$lang = $user->lang;
if ( !(phpbb_version_compare(PHPBB_VERSION, '3.2.0', '>=') && phpbb_version_compare(PHPBB_VERSION, '3.3.0@dev', '<')) )
{
$lang['EXTENSION_NOT_ENABLEABLE'] .= '<br>' . $user->lang('TH_ERROR_320_VERSION');
$is_enableable = false;
}
if (!phpbb_version_compare(PHP_VERSION, '5.4.7', '>='))
{
$lang['EXTENSION_NOT_ENABLEABLE'] .= '<br>' . $user->lang('TH_ERROR_PHP_VERSION');
$is_enableable = false;
}
$user->lang = $lang;
return $is_enableable;
}
}