From 647f3da685954d820aa93edd0d29715c3a9838ff Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Wed, 10 May 2023 11:02:56 +0200 Subject: [PATCH] use define php min --- _define.php | 5 ++++- src/Backend.php | 1 - src/Install.php | 1 - src/Manage.php | 1 - src/ManagePeriod.php | 1 - src/My.php | 11 ----------- 6 files changed, 4 insertions(+), 16 deletions(-) diff --git a/_define.php b/_define.php index fb5f7c6..68b9220 100644 --- a/_define.php +++ b/_define.php @@ -20,7 +20,10 @@ $this->registerModule( 'Jean-Christian Denis and contributors', '2023.04.23', [ - 'requires' => [['core', '2.26']], + 'requires' => [ + ['php', '8.1'], + ['core', '2.26'], + ], 'permissions' => dcCore::app()->auth->makePermissions([ dcAuth::PERMISSION_USAGE, dcAuth::PERMISSION_CONTENT_ADMIN, diff --git a/src/Backend.php b/src/Backend.php index 0646c44..f5033b9 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -24,7 +24,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([ dcCore::app()->auth::PERMISSION_USAGE, diff --git a/src/Install.php b/src/Install.php index abf6771..5fbe01d 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 22db30b..c1bf24a 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -33,7 +33,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([ dcCore::app()->auth::PERMISSION_USAGE, diff --git a/src/ManagePeriod.php b/src/ManagePeriod.php index 4acc01f..9e5b681 100644 --- a/src/ManagePeriod.php +++ b/src/ManagePeriod.php @@ -43,7 +43,6 @@ class ManagePeriod 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([ dcCore::app()->auth::PERMISSION_USAGE, diff --git a/src/My.php b/src/My.php index 4066154..b95a4a5 100644 --- a/src/My.php +++ b/src/My.php @@ -27,9 +27,6 @@ class My /** @var string This module meta type */ public const META_TYPE = 'periodical'; - /** @var string This module required php version */ - public const PHP_MIN = '8.1'; - /** * This module id. */ @@ -56,14 +53,6 @@ class My return dirname(__DIR__); } - /** - * Check this module PHP version compliant. - */ - public static function phpCompliant(): bool - { - return version_compare(phpversion(), self::PHP_MIN, '>='); - } - /** * Periods action combo. *