use define php min
This commit is contained in:
parent
5afc035872
commit
fa60910c57
@ -20,7 +20,10 @@ $this->registerModule(
|
|||||||
'Jean-Christian Denis, BG, Pierre Van Glabeke',
|
'Jean-Christian Denis, BG, Pierre Van Glabeke',
|
||||||
'2023.05.08',
|
'2023.05.08',
|
||||||
[
|
[
|
||||||
'requires' => [['core', '2.26']],
|
'requires' => [
|
||||||
|
['php', '8.1'],
|
||||||
|
['core', '2.26'],
|
||||||
|
],
|
||||||
'permissions' => dcCore::app()->auth->makePermissions([
|
'permissions' => dcCore::app()->auth->makePermissions([
|
||||||
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN,
|
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN,
|
||||||
]),
|
]),
|
||||||
|
@ -27,8 +27,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;
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,7 @@ class Config 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;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ class Frontend extends dcNsProcess
|
|||||||
{
|
{
|
||||||
public static function init(): bool
|
public static function init(): bool
|
||||||
{
|
{
|
||||||
static::$init = My::phpCompliant();
|
static::$init = defined('DC_RC_PATH');
|
||||||
|
|
||||||
return static::$init;
|
return static::$init;
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,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;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,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()->auth)
|
||||||
&& !is_null(dcCore::app()->blog)
|
&& !is_null(dcCore::app()->blog)
|
||||||
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
|
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
|
||||||
|
@ -42,7 +42,6 @@ class ManageFeed 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_CONTENT_ADMIN,
|
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN,
|
||||||
|
11
src/My.php
11
src/My.php
@ -55,9 +55,6 @@ class My
|
|||||||
'FeedFeedURL',
|
'FeedFeedURL',
|
||||||
];
|
];
|
||||||
|
|
||||||
/** @var string This module required php version */
|
|
||||||
public const PHP_MIN = '8.1';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This module id.
|
* This module id.
|
||||||
*/
|
*/
|
||||||
@ -83,12 +80,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, '>=');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ class Prepend extends dcNsProcess
|
|||||||
{
|
{
|
||||||
public static function init(): bool
|
public static function init(): bool
|
||||||
{
|
{
|
||||||
static::$init = My::phpCompliant();
|
static::$init = defined('DC_RC_PATH');
|
||||||
|
|
||||||
return static::$init;
|
return static::$init;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ class Uninstall extends dcNsProcess
|
|||||||
->addUserAction(
|
->addUserAction(
|
||||||
'tables',
|
'tables',
|
||||||
'delete',
|
'delete',
|
||||||
My::TABLE_NAME
|
My::TABLE_NAME,
|
||||||
)
|
)
|
||||||
->addUserAction(
|
->addUserAction(
|
||||||
'plugins',
|
'plugins',
|
||||||
|
Loading…
Reference in New Issue
Block a user