-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathext.php
More file actions
46 lines (39 loc) · 1.15 KB
/
Copy pathext.php
File metadata and controls
46 lines (39 loc) · 1.15 KB
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
<?php
/**
*
* @package Recent Topics Extension
* @copyright (c) 2015 PayBas
* @license GNU General Public License, version 2 (GPL-2.0)
*
* Based on the original NV Recent Topics by Joas Schilling (nickvergessen)
*/
namespace avathar\recenttopics;
/**
* Extension class for custom enable/disable/purge actions
*/
class ext extends \phpbb\extension\base
{
const RT_VERSION = '3.0.0';
const MIN_PHP_VERSION = '8.1.0';
const MIN_PHPBB_VERSION = '3.3.0';
/**
* Check whether the extension can be enabled.
*
* @return bool|array True if enableable, or an array of error language keys otherwise
*/
public function is_enableable()
{
$errors = [];
$user = $this->container->get('user');
$user->add_lang_ext('avathar/recenttopics', 'recenttopics');
if (version_compare(PHP_VERSION, self::MIN_PHP_VERSION, '<'))
{
$errors[] = $user->lang('RECENTTOPICS_PHP_VERSION_FAIL', self::MIN_PHP_VERSION, PHP_VERSION);
}
if (phpbb_version_compare(PHPBB_VERSION, self::MIN_PHPBB_VERSION, '<'))
{
$errors[] = $user->lang('RECENTTOPICS_PHPBB_VERSION_FAIL', self::MIN_PHPBB_VERSION, PHPBB_VERSION);
}
return empty($errors) ? true : $errors;
}
}