-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathext.php
More file actions
45 lines (40 loc) · 1023 Bytes
/
ext.php
File metadata and controls
45 lines (40 loc) · 1023 Bytes
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
<?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.3.0 due to the expectation that all posts are parsed by textformatter */
public const PHPBB_MIN_VERSION = '3.3.0';
/**
* Enable extension if phpBB minimum version requirement is met
* (check database and filesystem)
*
* @return bool
*/
public function is_enableable()
{
$config_version = $this->container->get('config')['version'];
return $this->is_version_compatible($config_version)
&& $this->is_version_compatible(PHPBB_VERSION);
}
/**
* Check if a version is within the acceptable range
*
* @param string $version Version to check
* @return bool
*/
private function is_version_compatible($version)
{
return phpbb_version_compare($version, self::PHPBB_MIN_VERSION, '>=');
}
}