add php min
This commit is contained in:
parent
8f31483f9e
commit
cb52f33cd1
3 changed files with 22 additions and 2 deletions
|
@ -28,7 +28,9 @@ class Backend extends dcNsProcess
|
|||
{
|
||||
public static function init(): bool
|
||||
{
|
||||
static::$init = defined('DC_CONTEXT_ADMIN');
|
||||
static::$init = defined('DC_CONTEXT_ADMIN')
|
||||
&& dcCore::app()->auth?->isSuperAdmin()
|
||||
&& My::phpCompliant();
|
||||
|
||||
return static::$init;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,9 @@ class Manage extends dcNsProcess
|
|||
{
|
||||
public static function init(): bool
|
||||
{
|
||||
static::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->auth->isSuperAdmin();
|
||||
static::$init = defined('DC_CONTEXT_ADMIN')
|
||||
&& dcCore::app()->auth?->isSuperAdmin()
|
||||
&& My::phpCompliant();
|
||||
|
||||
return static::$init;
|
||||
}
|
||||
|
|
16
src/My.php
16
src/My.php
|
@ -18,6 +18,14 @@ use dcCore;
|
|||
|
||||
class My
|
||||
{
|
||||
/**
|
||||
* @var string PHP min version
|
||||
*/
|
||||
public const PHP_MIN = '8.1';
|
||||
|
||||
/**
|
||||
* @var string Admin list ID
|
||||
*/
|
||||
public const BACKEND_LIST_ID = 'dcloglist';
|
||||
|
||||
/**
|
||||
|
@ -35,4 +43,12 @@ class My
|
|||
{
|
||||
return __((string) dcCore::app()->plugins->moduleInfo(self::id(), 'name'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check php version
|
||||
*/
|
||||
public static function phpCompliant(): bool
|
||||
{
|
||||
return version_compare(phpversion(), self::PHP_MIN, '>=');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue