use define php min

This commit is contained in:
Jean-Christian Paul Denis 2023-05-10 11:31:55 +02:00
parent 9466be24ff
commit 33c935e2ea
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
5 changed files with 3 additions and 16 deletions

View File

@ -21,6 +21,7 @@ $this->registerModule(
'1.0.1', '1.0.1',
[ [
'requires' => [ 'requires' => [
['php', '8.1'],
['core', '2.26'], ['core', '2.26'],
['Uninstaller', '0.8'], ['Uninstaller', '0.8'],
], ],

View File

@ -25,8 +25,7 @@ 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();
return static::$init; return static::$init;
} }

View File

@ -37,8 +37,7 @@ class Manage extends dcNsProcess
public static function init(): bool public static function init(): bool
{ {
static::$init = defined('DC_CONTEXT_ADMIN') static::$init = defined('DC_CONTEXT_ADMIN')
&& dcCore::app()->auth?->isSuperAdmin() && dcCore::app()->auth?->isSuperAdmin();
&& My::phpCompliant();
return static::$init; return static::$init;
} }

View File

@ -21,9 +21,6 @@ use dcCore;
*/ */
class My class My
{ {
/** @var string Required php version */
public const PHP_MIN = '8.1';
/** /**
* This module id. * This module id.
*/ */
@ -50,12 +47,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, '>=');
}
} }

View File

@ -28,7 +28,6 @@ class Prepend 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()
&& dcCore::app()->auth?->isSuperAdmin(); && dcCore::app()->auth?->isSuperAdmin();
return static::$init; return static::$init;