From 33c935e2eac227823e4578e2075c3e900809fe12 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Wed, 10 May 2023 11:31:55 +0200 Subject: [PATCH] use define php min --- _define.php | 1 + src/Backend.php | 3 +-- src/Manage.php | 3 +-- src/My.php | 11 ----------- src/Prepend.php | 1 - 5 files changed, 3 insertions(+), 16 deletions(-) diff --git a/_define.php b/_define.php index 9875afd..8db1b7c 100644 --- a/_define.php +++ b/_define.php @@ -21,6 +21,7 @@ $this->registerModule( '1.0.1', [ 'requires' => [ + ['php', '8.1'], ['core', '2.26'], ['Uninstaller', '0.8'], ], diff --git a/src/Backend.php b/src/Backend.php index 2841d64..07b89ee 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') - && My::phpCompliant(); + static::$init = defined('DC_CONTEXT_ADMIN'); return static::$init; } diff --git a/src/Manage.php b/src/Manage.php index b931e36..1058fdc 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -37,8 +37,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 8caea78..71f2426 100644 --- a/src/My.php +++ b/src/My.php @@ -21,9 +21,6 @@ use dcCore; */ class My { - /** @var string Required php version */ - public const PHP_MIN = '8.1'; - /** * This module id. */ @@ -50,12 +47,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 ca548ab..80441af 100644 --- a/src/Prepend.php +++ b/src/Prepend.php @@ -28,7 +28,6 @@ class Prepend extends dcNsProcess public static function init(): bool { static::$init = defined('DC_CONTEXT_ADMIN') - && My::phpCompliant() && dcCore::app()->auth?->isSuperAdmin(); return static::$init;