use define php min
This commit is contained in:
parent
ad87b40d31
commit
2cfff229a2
@ -20,7 +20,10 @@ $this->registerModule(
|
||||
'Jean-Christian Denis and Contributors',
|
||||
'0.9.1',
|
||||
[
|
||||
'requires' => [['core', '2.26']],
|
||||
'requires' => [
|
||||
['php', '8.1'],
|
||||
['core', '2.26'],
|
||||
],
|
||||
'permissions' => null,
|
||||
'type' => 'plugin',
|
||||
'settings' => [
|
||||
|
@ -26,8 +26,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;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ class Install extends dcNsProcess
|
||||
{
|
||||
public static function init(): bool
|
||||
{
|
||||
if (defined('DC_CONTEXT_ADMIN') && My::phpCompliant()) {
|
||||
if (defined('DC_CONTEXT_ADMIN')) {
|
||||
$version = dcCore::app()->plugins->moduleInfo(My::id(), 'version');
|
||||
static::$init = is_string($version) ? dcCore::app()->newVersion(My::id(), $version) : true;
|
||||
}
|
||||
|
@ -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 This module required php version */
|
||||
public const PHP_MIN = '8.1';
|
||||
|
||||
/**
|
||||
* This module id.
|
||||
*/
|
||||
@ -49,12 +46,4 @@ class My
|
||||
{
|
||||
return dirname(__DIR__);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check this module PHP version compliant.
|
||||
*/
|
||||
public static function phpCompliant(): bool
|
||||
{
|
||||
return version_compare(phpversion(), self::PHP_MIN, '>=');
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,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 New Issue
Block a user