add php min

This commit is contained in:
Jean-Christian Paul Denis 2023-03-19 22:50:56 +01:00
parent 8f31483f9e
commit cb52f33cd1
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
3 changed files with 22 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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, '>=');
}
}