use define php min

This commit is contained in:
Jean-Christian Paul Denis 2023-05-10 10:52:49 +02:00
parent d49f119764
commit 6903a2a479
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
6 changed files with 6 additions and 16 deletions

View File

@ -20,7 +20,10 @@ $this->registerModule(
'Osku and contributors', 'Osku and contributors',
'1.5', '1.5',
[ [
'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_CONTENT_ADMIN, dcCore::app()->auth::PERMISSION_CONTENT_ADMIN,
initTemplator::PERMISSION_TEMPLATOR, initTemplator::PERMISSION_TEMPLATOR,

View File

@ -25,7 +25,6 @@ class Backend 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()
&& !is_null(dcCore::app()->blog) && !is_null(dcCore::app()->auth) && !is_null(dcCore::app()->blog) && !is_null(dcCore::app()->auth)
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([ && dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
My::PERMISSION_TEMPLATOR, My::PERMISSION_TEMPLATOR,

View File

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

View File

@ -32,7 +32,6 @@ class Manage 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()
&& !is_null(dcCore::app()->auth) && !is_null(dcCore::app()->auth)
&& !is_null(dcCore::app()->blog) && !is_null(dcCore::app()->blog)
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([ && dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([

View File

@ -24,9 +24,6 @@ class My
/** @var string This module permission */ /** @var string This module permission */
public const PERMISSION_TEMPLATOR = 'templator'; public const PERMISSION_TEMPLATOR = 'templator';
/** @var string This module required php version */
public const PHP_MIN = '8.1';
/** /**
* This module id. * This module id.
*/ */
@ -52,12 +49,4 @@ 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, '>=');
}
} }

View File

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