use define php min
This commit is contained in:
parent
ad87b40d31
commit
2cfff229a2
@ -20,7 +20,10 @@ $this->registerModule(
|
|||||||
'Jean-Christian Denis and Contributors',
|
'Jean-Christian Denis and Contributors',
|
||||||
'0.9.1',
|
'0.9.1',
|
||||||
[
|
[
|
||||||
'requires' => [['core', '2.26']],
|
'requires' => [
|
||||||
|
['php', '8.1'],
|
||||||
|
['core', '2.26'],
|
||||||
|
],
|
||||||
'permissions' => null,
|
'permissions' => null,
|
||||||
'type' => 'plugin',
|
'type' => 'plugin',
|
||||||
'settings' => [
|
'settings' => [
|
||||||
|
@ -26,8 +26,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');
|
||||||
&& My::phpCompliant();
|
|
||||||
|
|
||||||
return static::$init;
|
return static::$init;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ class Install extends dcNsProcess
|
|||||||
{
|
{
|
||||||
public static function init(): bool
|
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');
|
$version = dcCore::app()->plugins->moduleInfo(My::id(), 'version');
|
||||||
static::$init = is_string($version) ? dcCore::app()->newVersion(My::id(), $version) : true;
|
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
|
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
@ -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, '>=');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ class Prepend 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()->auth?->isSuperAdmin();
|
&& dcCore::app()->auth?->isSuperAdmin();
|
||||||
|
|
||||||
return static::$init;
|
return static::$init;
|
||||||
|
Loading…
Reference in New Issue
Block a user