From 75afbcda1cc9e50fdfd675270a91cb6dc4a36289 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Wed, 10 May 2023 11:24:10 +0200 Subject: [PATCH] use define php min --- _define.php | 5 ++++- src/Backend.php | 1 - src/Manage.php | 1 - src/My.php | 11 ----------- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/_define.php b/_define.php index b223e5e..203900c 100644 --- a/_define.php +++ b/_define.php @@ -20,7 +20,10 @@ $this->registerModule( 'Tomtom and Contributors', '1.3.1', [ - '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 151b7db..a5397b3 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -27,7 +27,6 @@ class Backend extends dcNsProcess public static function init(): bool { static::$init = defined('DC_CONTEXT_ADMIN') - && My::phpCompliant() && !is_null(dcCore::app()->auth) && dcCore::app()->auth->isSuperAdmin(); diff --git a/src/Manage.php b/src/Manage.php index db19ac1..ced63d2 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -35,7 +35,6 @@ class Manage extends dcNsProcess public static function init(): bool { static::$init = defined('DC_CONTEXT_ADMIN') - && My::phpCompliant() && !is_null(dcCore::app()->auth) && dcCore::app()->auth->isSuperAdmin(); diff --git a/src/My.php b/src/My.php index df578b0..b880782 100644 --- a/src/My.php +++ b/src/My.php @@ -24,9 +24,6 @@ class My /** @var string Admin list ID */ public const BACKEND_LIST_ID = 'dcloglist'; - /** @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, '>='); - } }