From fcbec77626c301acff369d574db95bcd5fed21b5 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Wed, 10 May 2023 11:12:47 +0200 Subject: [PATCH] use define php min --- _define.php | 5 ++++- src/Backend.php | 3 +-- src/Config.php | 3 +-- src/Install.php | 1 - src/Manage.php | 3 +-- src/My.php | 11 ----------- 6 files changed, 7 insertions(+), 19 deletions(-) diff --git a/_define.php b/_define.php index 60f981a..45ca374 100644 --- a/_define.php +++ b/_define.php @@ -20,7 +20,10 @@ $this->registerModule( 'Jean-Christian Denis and contributors', '1.2', [ - '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 e4cc4e9..e41734f 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -31,8 +31,7 @@ class Backend extends dcNsProcess { static::$init = defined('DC_CONTEXT_ADMIN') && !is_null(dcCore::app()->auth) - && dcCore::app()->auth->isSuperAdmin() - && My::phpCompliant(); + && dcCore::app()->auth->isSuperAdmin(); return static::$init; } diff --git a/src/Config.php b/src/Config.php index b9097b7..78c0b54 100644 --- a/src/Config.php +++ b/src/Config.php @@ -40,8 +40,7 @@ class Config extends dcNsProcess { static::$init = defined('DC_CONTEXT_ADMIN') && !is_null(dcCore::app()->auth) - && dcCore::app()->auth->isSuperAdmin() - && My::phpCompliant(); + && dcCore::app()->auth->isSuperAdmin(); return static::$init; } diff --git a/src/Install.php b/src/Install.php index 3673329..9411ea3 100644 --- a/src/Install.php +++ b/src/Install.php @@ -38,7 +38,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 da3f930..c9e030b 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -55,8 +55,7 @@ class Manage extends dcNsProcess { static::$init = defined('DC_CONTEXT_ADMIN') && !is_null(dcCore::app()->auth) - && dcCore::app()->auth->isSuperAdmin() - && My::phpCompliant(); + && dcCore::app()->auth->isSuperAdmin(); return static::$init; } diff --git a/src/My.php b/src/My.php index 4551190..8cdb5bb 100644 --- a/src/My.php +++ b/src/My.php @@ -21,9 +21,6 @@ use dcCore; */ class My { - /** @var string This module required php version */ - public const PHP_MIN = '8.1'; - /** * This module id. */ @@ -49,12 +46,4 @@ class My { return dirname(__DIR__); } - - /** - * Check this module PHP version compliant. - */ - public static function phpCompliant(): bool - { - return version_compare(phpversion(), self::PHP_MIN, '>='); - } }