-
Notifications
You must be signed in to change notification settings - Fork 14
/
ext.php
38 lines (34 loc) · 981 Bytes
/
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
<?php
/**
*
* Topic Preview
*
* @copyright (c) 2015 Matt Friedman
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
namespace vse\topicpreview;
/**
* Extension class for custom enable/disable/purge actions
*/
class ext extends \phpbb\extension\base
{
/** @var string Require 3.2.0 due to updated INCLUDECSS and ordered services */
const PHPBB_MIN_VERSION = '3.2.0';
/** @var string */
const PHPBB_MAX_VERSION = '4.0.0-dev';
/**
* Enable extension if phpBB minimum version requirement is met
* (check database and filesystem)
*
* @return bool
*/
public function is_enableable()
{
$config = $this->container->get('config');
return phpbb_version_compare($config['version'], self::PHPBB_MIN_VERSION, '>=')
&& phpbb_version_compare($config['version'], self::PHPBB_MAX_VERSION, '<')
&& phpbb_version_compare(PHPBB_VERSION, self::PHPBB_MIN_VERSION, '>=')
&& phpbb_version_compare(PHPBB_VERSION, self::PHPBB_MAX_VERSION, '<');
}
}