1 | <?php |
||
2 | /** |
||
3 | * |
||
4 | * Topic Preview |
||
5 | * |
||
6 | * @copyright (c) 2015 Matt Friedman |
||
7 | * @license GNU General Public License, version 2 (GPL-2.0) |
||
8 | * |
||
9 | */ |
||
10 | |||
11 | namespace vse\topicpreview; |
||
12 | |||
13 | /** |
||
14 | * Extension class for custom enable/disable/purge actions |
||
15 | */ |
||
16 | class ext extends \phpbb\extension\base |
||
17 | { |
||
18 | /** @var string Require 3.2.0 due to updated INCLUDECSS and ordered services */ |
||
19 | const PHPBB_MIN_VERSION = '3.2.0'; |
||
20 | |||
21 | /** @var string */ |
||
22 | const PHPBB_MAX_VERSION = '4.0.0-dev'; |
||
23 | |||
24 | /** |
||
25 | * Enable extension if phpBB minimum version requirement is met |
||
26 | 3 | * (check database and filesystem) |
|
27 | * |
||
28 | 3 | * @return bool |
|
29 | 3 | */ |
|
30 | public function is_enableable() |
||
31 | { |
||
32 | $config = $this->container->get('config'); |
||
33 | return phpbb_version_compare($config['version'], self::PHPBB_MIN_VERSION, '>=') |
||
34 | && phpbb_version_compare($config['version'], self::PHPBB_MAX_VERSION, '<') |
||
35 | && phpbb_version_compare(PHPBB_VERSION, self::PHPBB_MIN_VERSION, '>=') |
||
36 | && phpbb_version_compare(PHPBB_VERSION, self::PHPBB_MAX_VERSION, '<'); |
||
37 | } |
||
38 | } |
||
39 |