add php min, require php >= 8.1

This commit is contained in:
Jean-Christian Paul Denis 2023-03-16 23:56:25 +01:00
parent 381f065d11
commit c21672138e
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
3 changed files with 13 additions and 2 deletions

View File

@ -24,7 +24,9 @@ class Backend extends dcNsProcess
{
public static function init(): bool
{
self::$init = defined('DC_CONTEXT_ADMIN');
if (defined('DC_CONTEXT_ADMIN')) {
self::$init = dcCore::app()->auth->isSuperAdmin() && version_compare(phpversion(), My::PHP_MIN, '>=');
}
return self::$init;
}

View File

@ -33,7 +33,13 @@ class Config extends dcNsProcess
{
public static function init(): bool
{
self::$init = defined('DC_CONTEXT_ADMIN');
if (defined('DC_CONTEXT_ADMIN')) {
if (version_compare(phpversion(), My::PHP_MIN, '>=')) {
self::$init = true;
} else {
dcCore::app()->error->add(sprintf(__('%s required php >= %s'), My::id(), My::PHP_MIN));
}
}
return self::$init;
}

View File

@ -18,6 +18,9 @@ use dcCore;
class My
{
/** @var string Required php version */
public const PHP_MIN = '8.1';
/** @var array Excluded files */
public const EXCLUDED_FILES = [
'.',