use define php min
This commit is contained in:
parent
9466be24ff
commit
33c935e2ea
5 changed files with 3 additions and 16 deletions
|
@ -21,6 +21,7 @@ $this->registerModule(
|
|||
'1.0.1',
|
||||
[
|
||||
'requires' => [
|
||||
['php', '8.1'],
|
||||
['core', '2.26'],
|
||||
['Uninstaller', '0.8'],
|
||||
],
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
11
src/My.php
11
src/My.php
|
@ -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, '>=');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue