check php version
parent
061b69e803
commit
03ba85d38e
|
@ -35,7 +35,7 @@ class Backend extends dcNsProcess
|
|||
public static function init(): bool
|
||||
{
|
||||
if (defined('DC_CONTEXT_ADMIN')) {
|
||||
self::$init = true;
|
||||
self::$init = dcCore::app()->auth->isSuperAdmin() && version_compare(phpversion(), My::PHP_MIN, '>=');
|
||||
}
|
||||
|
||||
return self::$init;
|
||||
|
|
|
@ -43,10 +43,12 @@ class Config extends dcNsProcess
|
|||
public static function init(): bool
|
||||
{
|
||||
if (defined('DC_CONTEXT_ADMIN')) {
|
||||
dcPage::checkSuper();
|
||||
self::$init = true;
|
||||
if (version_compare(phpversion(), My::PHP_MIN, '>=')) {
|
||||
self::$init = dcCore::app()->auth->isSuperAdmin();
|
||||
} else {
|
||||
dcCore::app()->error->add(sprintf(__('%s required php >= %s'), My::id(), My::PHP_MIN));
|
||||
}
|
||||
}
|
||||
|
||||
return self::$init;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,10 @@ class Install extends dcNsProcess
|
|||
|
||||
public static function init(): bool
|
||||
{
|
||||
self::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->newVersion(My::id(), dcCore::app()->plugins->moduleInfo(My::id(), 'version'));
|
||||
if (defined('DC_CONTEXT_ADMIN')) {
|
||||
self::$init = version_compare(phpversion(), My::PHP_MIN, '>=')
|
||||
&& dcCore::app()->newVersion(My::id(), dcCore::app()->plugins->moduleInfo(My::id(), 'version'));
|
||||
}
|
||||
|
||||
return self::$init;
|
||||
}
|
||||
|
|
|
@ -51,13 +51,14 @@ class Manage extends dcNsProcess
|
|||
public static function init(): bool
|
||||
{
|
||||
if (defined('DC_CONTEXT_ADMIN')) {
|
||||
dcPage::checkSuper();
|
||||
self::$init = dcCore::app()->auth->isSuperAdmin() && version_compare(phpversion(), My::PHP_MIN, '>=');
|
||||
}
|
||||
|
||||
if (self::$init) {
|
||||
self::$improve = new Core();
|
||||
self::$type = self::getType();
|
||||
self::$module = self::getModule();
|
||||
self::$action = self::getAction();
|
||||
self::$init = true;
|
||||
}
|
||||
|
||||
return self::$init;
|
||||
|
|
Loading…
Reference in New Issue