diff --git a/_define.php b/_define.php index a3facd5..6d84b37 100644 --- a/_define.php +++ b/_define.php @@ -20,7 +20,10 @@ $this->registerModule( 'Jean-Christian Denis', '2023.04.22', [ - 'requires' => [['core', '2.26']], + 'requires' => [ + ['php', '8.1'], + ['core', '2.26'], + ], 'permissions' => null, 'type' => 'plugin', 'support' => 'https://github.com/JcDenis/' . basename(__DIR__), diff --git a/src/Backend.php b/src/Backend.php index 7f6ea81..5b7284a 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -25,8 +25,7 @@ class Backend extends dcNsProcess public static function init(): bool { static::$init = defined('DC_CONTEXT_ADMIN') - && dcCore::app()->auth?->isSuperAdmin() - && My::phpCompliant(); + && dcCore::app()->auth?->isSuperAdmin(); return static::$init; } diff --git a/src/Config.php b/src/Config.php index c7ade47..fba3fa7 100644 --- a/src/Config.php +++ b/src/Config.php @@ -34,8 +34,7 @@ class Config extends dcNsProcess public static function init(): bool { static::$init == defined('DC_CONTEXT_ADMIN') - && dcCore::app()->auth?->isSuperAdmin() - && My::phpCompliant(); + && dcCore::app()->auth?->isSuperAdmin(); return static::$init; } diff --git a/src/Install.php b/src/Install.php index c12a8b6..5fbc34a 100644 --- a/src/Install.php +++ b/src/Install.php @@ -24,7 +24,6 @@ class Install extends dcNsProcess public static function init(): bool { static::$init = defined('DC_CONTEXT_ADMIN') - && My::phpCompliant() && dcCore::app()->newVersion(My::id(), dcCore::app()->plugins->moduleInfo(My::id(), 'version')); return static::$init; diff --git a/src/Manage.php b/src/Manage.php index be5f220..d6ec9f9 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -36,8 +36,7 @@ class Manage extends dcNsProcess public static function init(): bool { static::$init = defined('DC_CONTEXT_ADMIN') - && dcCore::app()->auth?->isSuperAdmin() - && My::phpCompliant(); + && dcCore::app()->auth?->isSuperAdmin(); return static::$init; } diff --git a/src/My.php b/src/My.php index 66e8b9e..fb0e8e8 100644 --- a/src/My.php +++ b/src/My.php @@ -24,9 +24,6 @@ class My /** @var string Licenses default templates folder name */ public const TEMPLATE_FOLDER = 'licenses'; - /** @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, '>='); - } }