use define php min
This commit is contained in:
parent
3e7c370f2d
commit
647f3da685
@ -20,7 +20,10 @@ $this->registerModule(
|
|||||||
'Jean-Christian Denis and contributors',
|
'Jean-Christian Denis and contributors',
|
||||||
'2023.04.23',
|
'2023.04.23',
|
||||||
[
|
[
|
||||||
'requires' => [['core', '2.26']],
|
'requires' => [
|
||||||
|
['php', '8.1'],
|
||||||
|
['core', '2.26'],
|
||||||
|
],
|
||||||
'permissions' => dcCore::app()->auth->makePermissions([
|
'permissions' => dcCore::app()->auth->makePermissions([
|
||||||
dcAuth::PERMISSION_USAGE,
|
dcAuth::PERMISSION_USAGE,
|
||||||
dcAuth::PERMISSION_CONTENT_ADMIN,
|
dcAuth::PERMISSION_CONTENT_ADMIN,
|
||||||
|
@ -24,7 +24,6 @@ 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()
|
|
||||||
&& !is_null(dcCore::app()->blog) && !is_null(dcCore::app()->auth)
|
&& !is_null(dcCore::app()->blog) && !is_null(dcCore::app()->auth)
|
||||||
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
|
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
|
||||||
dcCore::app()->auth::PERMISSION_USAGE,
|
dcCore::app()->auth::PERMISSION_USAGE,
|
||||||
|
@ -24,7 +24,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;
|
||||||
|
@ -33,7 +33,6 @@ 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')
|
||||||
&& My::phpCompliant()
|
|
||||||
&& !is_null(dcCore::app()->auth) && !is_null(dcCore::app()->blog)
|
&& !is_null(dcCore::app()->auth) && !is_null(dcCore::app()->blog)
|
||||||
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
|
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
|
||||||
dcCore::app()->auth::PERMISSION_USAGE,
|
dcCore::app()->auth::PERMISSION_USAGE,
|
||||||
|
@ -43,7 +43,6 @@ class ManagePeriod 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()
|
|
||||||
&& !is_null(dcCore::app()->auth) && !is_null(dcCore::app()->blog)
|
&& !is_null(dcCore::app()->auth) && !is_null(dcCore::app()->blog)
|
||||||
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
|
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
|
||||||
dcCore::app()->auth::PERMISSION_USAGE,
|
dcCore::app()->auth::PERMISSION_USAGE,
|
||||||
|
11
src/My.php
11
src/My.php
@ -27,9 +27,6 @@ class My
|
|||||||
/** @var string This module meta type */
|
/** @var string This module meta type */
|
||||||
public const META_TYPE = 'periodical';
|
public const META_TYPE = 'periodical';
|
||||||
|
|
||||||
/** @var string This module required php version */
|
|
||||||
public const PHP_MIN = '8.1';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This module id.
|
* This module id.
|
||||||
*/
|
*/
|
||||||
@ -56,14 +53,6 @@ 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, '>=');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Periods action combo.
|
* Periods action combo.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user