use define php min
This commit is contained in:
parent
8e0794b5f3
commit
fcbec77626
6 changed files with 7 additions and 19 deletions
|
@ -20,7 +20,10 @@ $this->registerModule(
|
||||||
'Jean-Christian Denis and contributors',
|
'Jean-Christian Denis and contributors',
|
||||||
'1.2',
|
'1.2',
|
||||||
[
|
[
|
||||||
'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__),
|
||||||
|
|
|
@ -31,8 +31,7 @@ class Backend extends dcNsProcess
|
||||||
{
|
{
|
||||||
static::$init = defined('DC_CONTEXT_ADMIN')
|
static::$init = defined('DC_CONTEXT_ADMIN')
|
||||||
&& !is_null(dcCore::app()->auth)
|
&& !is_null(dcCore::app()->auth)
|
||||||
&& dcCore::app()->auth->isSuperAdmin()
|
&& dcCore::app()->auth->isSuperAdmin();
|
||||||
&& My::phpCompliant();
|
|
||||||
|
|
||||||
return static::$init;
|
return static::$init;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,8 +40,7 @@ class Config extends dcNsProcess
|
||||||
{
|
{
|
||||||
static::$init = defined('DC_CONTEXT_ADMIN')
|
static::$init = defined('DC_CONTEXT_ADMIN')
|
||||||
&& !is_null(dcCore::app()->auth)
|
&& !is_null(dcCore::app()->auth)
|
||||||
&& dcCore::app()->auth->isSuperAdmin()
|
&& dcCore::app()->auth->isSuperAdmin();
|
||||||
&& My::phpCompliant();
|
|
||||||
|
|
||||||
return static::$init;
|
return static::$init;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,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;
|
||||||
|
|
|
@ -55,8 +55,7 @@ class Manage extends dcNsProcess
|
||||||
{
|
{
|
||||||
static::$init = defined('DC_CONTEXT_ADMIN')
|
static::$init = defined('DC_CONTEXT_ADMIN')
|
||||||
&& !is_null(dcCore::app()->auth)
|
&& !is_null(dcCore::app()->auth)
|
||||||
&& dcCore::app()->auth->isSuperAdmin()
|
&& dcCore::app()->auth->isSuperAdmin();
|
||||||
&& My::phpCompliant();
|
|
||||||
|
|
||||||
return static::$init;
|
return static::$init;
|
||||||
}
|
}
|
||||||
|
|
11
src/My.php
11
src/My.php
|
@ -21,9 +21,6 @@ use dcCore;
|
||||||
*/
|
*/
|
||||||
class My
|
class My
|
||||||
{
|
{
|
||||||
/** @var string This module required php version */
|
|
||||||
public const PHP_MIN = '8.1';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This module id.
|
* This module id.
|
||||||
*/
|
*/
|
||||||
|
@ -49,12 +46,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 a new issue