From 6903a2a4796621ea800fea4e56ffced6aeb4c4af Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Wed, 10 May 2023 10:52:49 +0200 Subject: [PATCH] use define php min --- _define.php | 5 ++++- src/Backend.php | 1 - src/Frontend.php | 2 +- src/Manage.php | 1 - src/My.php | 11 ----------- src/Prepend.php | 2 +- 6 files changed, 6 insertions(+), 16 deletions(-) diff --git a/_define.php b/_define.php index 1001531..816a690 100644 --- a/_define.php +++ b/_define.php @@ -20,7 +20,10 @@ $this->registerModule( 'Osku and contributors', '1.5', [ - 'requires' => [['core', '2.26']], + 'requires' => [ + ['php', '8.1'], + ['core', '2.26'], + ], 'permissions' => dcCore::app()->auth->makePermissions([ dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, initTemplator::PERMISSION_TEMPLATOR, diff --git a/src/Backend.php b/src/Backend.php index 8fc1661..7ee38af 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -25,7 +25,6 @@ class Backend extends dcNsProcess public static function init(): bool { static::$init == defined('DC_CONTEXT_ADMIN') - && My::phpCompliant() && !is_null(dcCore::app()->blog) && !is_null(dcCore::app()->auth) && dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([ My::PERMISSION_TEMPLATOR, diff --git a/src/Frontend.php b/src/Frontend.php index 525936e..23e64dc 100644 --- a/src/Frontend.php +++ b/src/Frontend.php @@ -25,7 +25,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/Manage.php b/src/Manage.php index a1c62c2..bba5483 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -32,7 +32,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([ diff --git a/src/My.php b/src/My.php index fb0b458..3caafdb 100644 --- a/src/My.php +++ b/src/My.php @@ -24,9 +24,6 @@ class My /** @var string This module permission */ public const PERMISSION_TEMPLATOR = 'templator'; - /** @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, '>='); - } } diff --git a/src/Prepend.php b/src/Prepend.php index 44924f1..59ed1d4 100644 --- a/src/Prepend.php +++ b/src/Prepend.php @@ -21,7 +21,7 @@ class Prepend extends dcNsProcess { public static function init(): bool { - static::$init = My::phpCompliant(); + static::$init = defined('DC_RC_PATH'); return static::$init; }