From 4305d12954084ac1c324f6f1801ae48e4475f560 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Wed, 10 May 2023 10:49:16 +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 ----------- src/Prepend.php | 3 +-- 7 files changed, 8 insertions(+), 21 deletions(-) diff --git a/_define.php b/_define.php index afb575b..c77bf43 100644 --- a/_define.php +++ b/_define.php @@ -20,7 +20,10 @@ $this->registerModule( 'Jean-Christian Denis & contributors', '2023.04.23', [ - 'requires' => [['core', '2.26']], + 'requires' => [ + ['php', '8.1'], + ['core', '2.26'], + ], 'permissions' => null, 'type' => 'plugin', 'support' => 'http://forum.dotclear.org/viewtopic.php?id=39220', diff --git a/src/Backend.php b/src/Backend.php index e349369..865c43d 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') - && dcCore::app()->auth?->isSuperAdmin() - && My::phpCompliant(); + && dcCore::app()->auth?->isSuperAdmin(); return static::$init; } diff --git a/src/Config.php b/src/Config.php index 929da66..800a68b 100644 --- a/src/Config.php +++ b/src/Config.php @@ -36,8 +36,7 @@ class Config 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/Install.php b/src/Install.php index 5920975..b197d4b 100644 --- a/src/Install.php +++ b/src/Install.php @@ -24,7 +24,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 afc02a5..2c51545 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -40,8 +40,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 3b8895c..0550a96 100644 --- a/src/My.php +++ b/src/My.php @@ -24,9 +24,6 @@ class My /** @var string Locales folder name */ public const LOCALES_FOLDER = 'locales'; - /** @var string This module required php version */ - public const PHP_MIN = '8.1'; - /** * This module id. */ @@ -53,14 +50,6 @@ class My return dirname(__DIR__); } - /** - * Check this module PHP version compliant. - */ - public static function phpCompliant(): bool - { - return version_compare(phpversion(), self::PHP_MIN, '>='); - } - /** * List of allowed backup folder */ diff --git a/src/Prepend.php b/src/Prepend.php index e039311..6f73d5e 100644 --- a/src/Prepend.php +++ b/src/Prepend.php @@ -22,8 +22,7 @@ class Prepend 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; }