use define php min

master
Jean-Christian Paul Denis 2023-05-10 10:04:01 +02:00
parent 0badada4f6
commit 9ce25d686b
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
3 changed files with 4 additions and 13 deletions

View File

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

View File

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

View File

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