use define php min

This commit is contained in:
Jean-Christian Denis 2023-05-10 11:24:10 +02:00
parent 4994f376ca
commit 75afbcda1c
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
4 changed files with 4 additions and 14 deletions

View file

@ -20,7 +20,10 @@ $this->registerModule(
'Tomtom and Contributors',
'1.3.1',
[
'requires' => [['core', '2.26']],
'requires' => [
['php', '8.1'],
['core', '2.26'],
],
'permissions' => null,
'type' => 'plugin',
'support' => 'https://github.com/JcDenis/' . basename(__DIR__),

View file

@ -27,7 +27,6 @@ class Backend extends dcNsProcess
public static function init(): bool
{
static::$init = defined('DC_CONTEXT_ADMIN')
&& My::phpCompliant()
&& !is_null(dcCore::app()->auth)
&& dcCore::app()->auth->isSuperAdmin();

View file

@ -35,7 +35,6 @@ class Manage extends dcNsProcess
public static function init(): bool
{
static::$init = defined('DC_CONTEXT_ADMIN')
&& My::phpCompliant()
&& !is_null(dcCore::app()->auth)
&& dcCore::app()->auth->isSuperAdmin();

View file

@ -24,9 +24,6 @@ class My
/** @var string Admin list ID */
public const BACKEND_LIST_ID = 'dcloglist';
/** @var string This module required php version */
public const PHP_MIN = '8.1';
/**
* This module id.
*/
@ -52,12 +49,4 @@ class My
{
return dirname(__DIR__);
}
/**
* Check this module PHP version compliant.
*/
public static function phpCompliant(): bool
{
return version_compare(phpversion(), self::PHP_MIN, '>=');
}
}