use define php min
This commit is contained in:
parent
7f281007e6
commit
1da7953741
@ -22,7 +22,10 @@ $this->registerModule(
|
|||||||
'Jean-Christian Denis',
|
'Jean-Christian Denis',
|
||||||
'2023.04.27',
|
'2023.04.27',
|
||||||
[
|
[
|
||||||
'requires' => [['core', '2.26']],
|
'requires' => [
|
||||||
|
['php', '8.1'],
|
||||||
|
['core', '2.26'],
|
||||||
|
],
|
||||||
'permissions' => null,
|
'permissions' => null,
|
||||||
'type' => 'plugin',
|
'type' => 'plugin',
|
||||||
'support' => 'https://github.com/JcDenis/' . basename(__DIR__),
|
'support' => 'https://github.com/JcDenis/' . basename(__DIR__),
|
||||||
|
@ -25,8 +25,7 @@ class Backend extends dcNsProcess
|
|||||||
public static function init(): bool
|
public static function init(): bool
|
||||||
{
|
{
|
||||||
static::$init == defined('DC_CONTEXT_ADMIN')
|
static::$init == defined('DC_CONTEXT_ADMIN')
|
||||||
&& dcCore::app()->auth?->isSuperAdmin()
|
&& dcCore::app()->auth?->isSuperAdmin();
|
||||||
&& My::phpCompliant();
|
|
||||||
|
|
||||||
return static::$init;
|
return static::$init;
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,7 @@ class Config extends dcNsProcess
|
|||||||
public static function init(): bool
|
public static function init(): bool
|
||||||
{
|
{
|
||||||
static::$init == defined('DC_CONTEXT_ADMIN')
|
static::$init == defined('DC_CONTEXT_ADMIN')
|
||||||
&& dcCore::app()->auth?->isSuperAdmin()
|
&& dcCore::app()->auth?->isSuperAdmin();
|
||||||
&& My::phpCompliant();
|
|
||||||
|
|
||||||
return static::$init;
|
return static::$init;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@ class Install extends dcNsProcess
|
|||||||
public static function init(): bool
|
public static function init(): bool
|
||||||
{
|
{
|
||||||
static::$init = defined('DC_CONTEXT_ADMIN')
|
static::$init = defined('DC_CONTEXT_ADMIN')
|
||||||
&& My::phpCompliant()
|
|
||||||
&& dcCore::app()->newVersion(My::id(), dcCore::app()->plugins->moduleInfo(My::id(), 'version'));
|
&& dcCore::app()->newVersion(My::id(), dcCore::app()->plugins->moduleInfo(My::id(), 'version'));
|
||||||
|
|
||||||
return static::$init;
|
return static::$init;
|
||||||
|
@ -32,8 +32,7 @@ class Manage extends dcNsProcess
|
|||||||
public static function init(): bool
|
public static function init(): bool
|
||||||
{
|
{
|
||||||
static::$init = defined('DC_CONTEXT_ADMIN')
|
static::$init = defined('DC_CONTEXT_ADMIN')
|
||||||
&& dcCore::app()->auth?->isSuperAdmin()
|
&& dcCore::app()->auth?->isSuperAdmin();
|
||||||
&& My::phpCompliant();
|
|
||||||
|
|
||||||
return static::$init;
|
return static::$init;
|
||||||
}
|
}
|
||||||
|
11
src/My.php
11
src/My.php
@ -35,9 +35,6 @@ class My
|
|||||||
'_disabled',
|
'_disabled',
|
||||||
];
|
];
|
||||||
|
|
||||||
/** @var string This module required php version */
|
|
||||||
public const PHP_MIN = '8.1';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This module id.
|
* This module id.
|
||||||
*/
|
*/
|
||||||
@ -63,12 +60,4 @@ class My
|
|||||||
{
|
{
|
||||||
return dirname(__DIR__);
|
return dirname(__DIR__);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check this module PHP version compliant.
|
|
||||||
*/
|
|
||||||
public static function phpCompliant(): bool
|
|
||||||
{
|
|
||||||
return version_compare(phpversion(), self::PHP_MIN, '>=');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user