use define php min

This commit is contained in:
Jean-Christian Denis 2023-05-10 11:31:55 +02:00
parent 9466be24ff
commit 33c935e2ea
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
5 changed files with 3 additions and 16 deletions

View file

@ -21,6 +21,7 @@ $this->registerModule(
'1.0.1',
[
'requires' => [
['php', '8.1'],
['core', '2.26'],
['Uninstaller', '0.8'],
],

View file

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

View file

@ -37,8 +37,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;
}

View file

@ -21,9 +21,6 @@ use dcCore;
*/
class My
{
/** @var string Required php version */
public const PHP_MIN = '8.1';
/**
* This module id.
*/
@ -50,12 +47,4 @@ class My
{
return dirname(__DIR__);
}
/**
* Check this module PHP version compliant.
*/
public static function phpCompliant(): bool
{
return version_compare(phpversion(), self::PHP_MIN, '>=');
}
}

View file

@ -28,7 +28,6 @@ class Prepend extends dcNsProcess
public static function init(): bool
{
static::$init = defined('DC_CONTEXT_ADMIN')
&& My::phpCompliant()
&& dcCore::app()->auth?->isSuperAdmin();
return static::$init;