use define php min
This commit is contained in:
parent
de34bd1b79
commit
4cf4cf1bd9
6 changed files with 5 additions and 16 deletions
|
@ -20,7 +20,10 @@ $this->registerModule(
|
|||
'Jean-Christian Denis and Contributors',
|
||||
'2023.04.25',
|
||||
[
|
||||
'requires' => [['core', '2.26']],
|
||||
'requires' => [
|
||||
['php', '8.0'],
|
||||
['core', '2.26'],
|
||||
],
|
||||
'permissions' => dcCore::app()->auth->makePermissions([
|
||||
dcCore::app()->auth::PERMISSION_USAGE,
|
||||
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN,
|
||||
|
|
|
@ -24,7 +24,6 @@ class Backend extends dcNsProcess
|
|||
public static function init(): bool
|
||||
{
|
||||
static::$init = defined('DC_CONTEXT_ADMIN')
|
||||
&& My::phpCompliant()
|
||||
&& !is_null(dcCore::app()->auth) && !is_null(dcCore::app()->blog)
|
||||
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
|
||||
dcCore::app()->auth::PERMISSION_USAGE,
|
||||
|
|
|
@ -21,7 +21,7 @@ class Frontend extends dcNsProcess
|
|||
{
|
||||
public static function init(): bool
|
||||
{
|
||||
static::$init = My::phpCompliant();
|
||||
static::$init = defined('DC_RC_PATH');
|
||||
|
||||
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;
|
||||
|
|
|
@ -29,7 +29,6 @@ class Manage extends dcNsProcess
|
|||
public static function init(): bool
|
||||
{
|
||||
static::$init = defined('DC_CONTEXT_ADMIN')
|
||||
&& My::phpCompliant()
|
||||
&& !is_null(dcCore::app()->auth) && !is_null(dcCore::app()->blog)
|
||||
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
|
||||
dcCore::app()->auth::PERMISSION_USAGE,
|
||||
|
|
11
src/My.php
11
src/My.php
|
@ -24,9 +24,6 @@ class My
|
|||
/** @var string Plugin table name */
|
||||
public const TABLE_NAME = 'post_option';
|
||||
|
||||
/** @var string This module required php version */
|
||||
public const PHP_MIN = '8.0';
|
||||
|
||||
/**
|
||||
* This module id.
|
||||
*/
|
||||
|
@ -52,12 +49,4 @@ class My
|
|||
{
|
||||
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