use define php min
This commit is contained in:
parent
212324642e
commit
4305d12954
@ -20,7 +20,10 @@ $this->registerModule(
|
||||
'Jean-Christian Denis & contributors',
|
||||
'2023.04.23',
|
||||
[
|
||||
'requires' => [['core', '2.26']],
|
||||
'requires' => [
|
||||
['php', '8.1'],
|
||||
['core', '2.26'],
|
||||
],
|
||||
'permissions' => null,
|
||||
'type' => 'plugin',
|
||||
'support' => 'http://forum.dotclear.org/viewtopic.php?id=39220',
|
||||
|
@ -25,8 +25,7 @@ class Backend 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;
|
||||
}
|
||||
|
@ -36,8 +36,7 @@ class Config 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;
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ class Install extends dcNsProcess
|
||||
public static function init(): bool
|
||||
{
|
||||
static::$init = defined('DC_CONTEXT_ADMIN')
|
||||
&& My::phpCompliant()
|
||||
&& dcCore::app()->newVersion(My::id(), dcCore::app()->plugins->moduleInfo(My::id(), 'version'));
|
||||
|
||||
return static::$init;
|
||||
|
@ -40,8 +40,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
@ -24,9 +24,6 @@ class My
|
||||
/** @var string Locales folder name */
|
||||
public const LOCALES_FOLDER = 'locales';
|
||||
|
||||
/** @var string This module required php version */
|
||||
public const PHP_MIN = '8.1';
|
||||
|
||||
/**
|
||||
* This module id.
|
||||
*/
|
||||
@ -53,14 +50,6 @@ class My
|
||||
return dirname(__DIR__);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check this module PHP version compliant.
|
||||
*/
|
||||
public static function phpCompliant(): bool
|
||||
{
|
||||
return version_compare(phpversion(), self::PHP_MIN, '>=');
|
||||
}
|
||||
|
||||
/**
|
||||
* List of allowed backup folder
|
||||
*/
|
||||
|
@ -22,8 +22,7 @@ class Prepend 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user