use define php min

This commit is contained in:
Jean-Christian Paul Denis 2023-05-10 09:53:09 +02:00
parent ad87b40d31
commit 2cfff229a2
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
6 changed files with 7 additions and 18 deletions

View File

@ -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' => [

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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, '>=');
}
}

View File

@ -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;