use define php min

This commit is contained in:
Jean-Christian Paul Denis 2023-05-10 11:43:16 +02:00
parent a4cfc8a29a
commit 8922853731
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
8 changed files with 4 additions and 18 deletions

View File

@ -20,7 +20,10 @@ $this->registerModule(
'Jean-Christian Denis and contributors', 'Jean-Christian Denis and contributors',
'3.1', '3.1',
[ [
'requires' => [['core', '2.26']], 'requires' => [
['php', '8.1'],
['core', '2.26']],
],
'permissions' => dcCore::app()->auth->makePermissions([ 'permissions' => dcCore::app()->auth->makePermissions([
dcCore::app()->auth::PERMISSION_USAGE, dcCore::app()->auth::PERMISSION_USAGE,
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, dcCore::app()->auth::PERMISSION_CONTENT_ADMIN,

View File

@ -39,7 +39,6 @@ class Backend extends dcNsProcess
{ {
static::$init = defined('DC_CONTEXT_ADMIN') static::$init = defined('DC_CONTEXT_ADMIN')
&& defined('ACTIVITY_REPORT') && defined('ACTIVITY_REPORT')
&& My::phpCompliant()
&& My::isInstalled(); && My::isInstalled();
return static::$init; return static::$init;

View File

@ -41,7 +41,6 @@ class Config extends dcNsProcess
{ {
static::$init == defined('DC_CONTEXT_ADMIN') static::$init == defined('DC_CONTEXT_ADMIN')
&& defined('ACTIVITY_REPORT') && defined('ACTIVITY_REPORT')
&& My::phpCompliant()
&& dcCore::app()->auth?->check(dcCore::app()->auth->makePermissions([ && dcCore::app()->auth?->check(dcCore::app()->auth->makePermissions([
dcAuth::PERMISSION_ADMIN, dcAuth::PERMISSION_ADMIN,
]), dcCore::app()->blog?->id); ]), dcCore::app()->blog?->id);

View File

@ -25,7 +25,6 @@ class Frontend extends dcNsProcess
public static function init(): bool public static function init(): bool
{ {
static::$init = defined('ACTIVITY_REPORT') static::$init = defined('ACTIVITY_REPORT')
&& My::phpCompliant()
&& My::isInstalled(); && My::isInstalled();
return static::$init; return static::$init;

View File

@ -31,7 +31,6 @@ class Install extends dcNsProcess
public static function init(): bool public static function init(): bool
{ {
static::$init = defined('DC_CONTEXT_ADMIN') static::$init = defined('DC_CONTEXT_ADMIN')
&& My::phpCompliant()
&& dcCore::app()->newVersion(My::id(), dcCore::app()->plugins->moduleInfo(My::id(), 'version')); && dcCore::app()->newVersion(My::id(), dcCore::app()->plugins->moduleInfo(My::id(), 'version'));
return static::$init; return static::$init;

View File

@ -38,7 +38,6 @@ class Manage extends dcNsProcess
{ {
static::$init = defined('DC_CONTEXT_ADMIN') static::$init = defined('DC_CONTEXT_ADMIN')
&& defined('ACTIVITY_REPORT') && defined('ACTIVITY_REPORT')
&& My::phpCompliant()
&& dcCore::app()->auth?->check(dcCore::app()->auth->makePermissions([ && dcCore::app()->auth?->check(dcCore::app()->auth->makePermissions([
dcAuth::PERMISSION_ADMIN, dcAuth::PERMISSION_ADMIN,
]), dcCore::app()->blog?->id); ]), dcCore::app()->blog?->id);

View File

@ -30,9 +30,6 @@ class My
/** @var int Incremental version by breaking changes */ /** @var int Incremental version by breaking changes */
public const COMPATIBILITY_VERSION = 3; public const COMPATIBILITY_VERSION = 3;
/** @var string Required php version */
public const PHP_MIN = '7.4';
/** /**
* This module id. * This module id.
*/ */
@ -59,14 +56,6 @@ class My
return dirname(__DIR__); 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. * Check is module is trully installed.
* *

View File

@ -26,7 +26,6 @@ class Prepend extends dcNsProcess
public static function init(): bool public static function init(): bool
{ {
static::$init = defined('DC_RC_PATH') static::$init = defined('DC_RC_PATH')
&& My::phpCompliant()
&& My::isInstalled(); && My::isInstalled();
return static::$init; return static::$init;