From 8922853731d6cb074132153d4d9c18250215ec5b Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Wed, 10 May 2023 11:43:16 +0200 Subject: [PATCH] use define php min --- _define.php | 5 ++++- src/Backend.php | 1 - src/Config.php | 1 - src/Frontend.php | 1 - src/Install.php | 1 - src/Manage.php | 1 - src/My.php | 11 ----------- src/Prepend.php | 1 - 8 files changed, 4 insertions(+), 18 deletions(-) diff --git a/_define.php b/_define.php index 48e746a..b716e90 100644 --- a/_define.php +++ b/_define.php @@ -20,7 +20,10 @@ $this->registerModule( 'Jean-Christian Denis and contributors', '3.1', [ - 'requires' => [['core', '2.26']], + 'requires' => [ + ['php', '8.1'], + ['core', '2.26']], + ], 'permissions' => dcCore::app()->auth->makePermissions([ dcCore::app()->auth::PERMISSION_USAGE, dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, diff --git a/src/Backend.php b/src/Backend.php index 579b037..b31c50b 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -39,7 +39,6 @@ class Backend extends dcNsProcess { static::$init = defined('DC_CONTEXT_ADMIN') && defined('ACTIVITY_REPORT') - && My::phpCompliant() && My::isInstalled(); return static::$init; diff --git a/src/Config.php b/src/Config.php index f4c2f6c..9901812 100644 --- a/src/Config.php +++ b/src/Config.php @@ -41,7 +41,6 @@ class Config extends dcNsProcess { static::$init == defined('DC_CONTEXT_ADMIN') && defined('ACTIVITY_REPORT') - && My::phpCompliant() && dcCore::app()->auth?->check(dcCore::app()->auth->makePermissions([ dcAuth::PERMISSION_ADMIN, ]), dcCore::app()->blog?->id); diff --git a/src/Frontend.php b/src/Frontend.php index 08e9516..becb098 100644 --- a/src/Frontend.php +++ b/src/Frontend.php @@ -25,7 +25,6 @@ class Frontend extends dcNsProcess public static function init(): bool { static::$init = defined('ACTIVITY_REPORT') - && My::phpCompliant() && My::isInstalled(); return static::$init; diff --git a/src/Install.php b/src/Install.php index 64c16cc..b326650 100644 --- a/src/Install.php +++ b/src/Install.php @@ -31,7 +31,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 c6e3693..cc577a1 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -38,7 +38,6 @@ class Manage extends dcNsProcess { static::$init = defined('DC_CONTEXT_ADMIN') && defined('ACTIVITY_REPORT') - && My::phpCompliant() && dcCore::app()->auth?->check(dcCore::app()->auth->makePermissions([ dcAuth::PERMISSION_ADMIN, ]), dcCore::app()->blog?->id); diff --git a/src/My.php b/src/My.php index b1f9192..32eca3d 100644 --- a/src/My.php +++ b/src/My.php @@ -30,9 +30,6 @@ class My /** @var int Incremental version by breaking changes */ public const COMPATIBILITY_VERSION = 3; - /** @var string Required php version */ - public const PHP_MIN = '7.4'; - /** * This module id. */ @@ -59,14 +56,6 @@ class My return dirname(__DIR__); } - /** - * Check this module PHP version compliant. - */ - public static function phpCompliant(): bool - { - return version_compare(phpversion(), self::PHP_MIN, '>='); - } - /** * Check is module is trully installed. * diff --git a/src/Prepend.php b/src/Prepend.php index 16fd939..f2895cd 100644 --- a/src/Prepend.php +++ b/src/Prepend.php @@ -26,7 +26,6 @@ class Prepend extends dcNsProcess public static function init(): bool { static::$init = defined('DC_RC_PATH') - && My::phpCompliant() && My::isInstalled(); return static::$init;