diff --git a/_define.php b/_define.php index 62f13cb..66bd162 100644 --- a/_define.php +++ b/_define.php @@ -20,7 +20,10 @@ $this->registerModule( 'Jean-Christian Denis and Contributors', '2023.04.23', [ - 'requires' => [['core', '2.26']], + 'requires' => [ + ['php', '8.1'], + ['core', '2.26'], + ], 'permissions' => dcCore::app()->auth->makePermissions([ dcAuth::PERMISSION_CONTENT_ADMIN, ]), diff --git a/src/Backend.php b/src/Backend.php index 9c4f57d..99a75fd 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -33,7 +33,6 @@ class Backend extends dcNsProcess public static function init(): bool { static::$init = defined('DC_CONTEXT_ADMIN') - && My::phpCompliant() && !is_null(dcCore::app()->auth) && !is_null(dcCore::app()->blog) && dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([ dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, diff --git a/src/Frontend.php b/src/Frontend.php index 6099393..74cb2c5 100644 --- a/src/Frontend.php +++ b/src/Frontend.php @@ -22,7 +22,7 @@ class Frontend extends dcNsProcess { public static function init(): bool { - static::$init = My::phpCompliant(); + static::$init = defined('DC_RC_PATH'); return static::$init; } diff --git a/src/Install.php b/src/Install.php index 856bacb..3aa2db1 100644 --- a/src/Install.php +++ b/src/Install.php @@ -25,7 +25,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 387fe04..806c983 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -42,7 +42,6 @@ class Manage extends dcNsProcess public static function init(): bool { static::$init = defined('DC_CONTEXT_ADMIN') - && My::phpCompliant() && !is_null(dcCore::app()->auth) && !is_null(dcCore::app()->blog) && dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([ dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, diff --git a/src/My.php b/src/My.php index 4043e14..9847dca 100644 --- a/src/My.php +++ b/src/My.php @@ -38,9 +38,6 @@ class My Filter\EpcFilterTwitter::class, ]; - /** @var string This module required php version */ - public const PHP_MIN = '8.1'; - /** * This module id. */ @@ -66,12 +63,4 @@ class My { return dirname(__DIR__); } - - /** - * Check this module PHP version compliant. - */ - public static function phpCompliant(): bool - { - return version_compare(phpversion(), self::PHP_MIN, '>='); - } } diff --git a/src/Prepend.php b/src/Prepend.php index 7e30265..3e4d81b 100644 --- a/src/Prepend.php +++ b/src/Prepend.php @@ -22,7 +22,7 @@ class Prepend extends dcNsProcess { public static function init(): bool { - static::$init = My::phpCompliant(); + static::$init = defined('DC_RC_PATH'); return static::$init; }