use define php min
This commit is contained in:
parent
a4cfc8a29a
commit
8922853731
@ -20,7 +20,10 @@ $this->registerModule(
|
||||
'Jean-Christian Denis and contributors',
|
||||
'3.1',
|
||||
[
|
||||
'requires' => [['core', '2.26']],
|
||||
'requires' => [
|
||||
['php', '8.1'],
|
||||
['core', '2.26']],
|
||||
],
|
||||
'permissions' => dcCore::app()->auth->makePermissions([
|
||||
dcCore::app()->auth::PERMISSION_USAGE,
|
||||
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN,
|
||||
|
@ -39,7 +39,6 @@ class Backend extends dcNsProcess
|
||||
{
|
||||
static::$init = defined('DC_CONTEXT_ADMIN')
|
||||
&& defined('ACTIVITY_REPORT')
|
||||
&& My::phpCompliant()
|
||||
&& My::isInstalled();
|
||||
|
||||
return static::$init;
|
||||
|
@ -41,7 +41,6 @@ class Config extends dcNsProcess
|
||||
{
|
||||
static::$init == defined('DC_CONTEXT_ADMIN')
|
||||
&& defined('ACTIVITY_REPORT')
|
||||
&& My::phpCompliant()
|
||||
&& dcCore::app()->auth?->check(dcCore::app()->auth->makePermissions([
|
||||
dcAuth::PERMISSION_ADMIN,
|
||||
]), dcCore::app()->blog?->id);
|
||||
|
@ -25,7 +25,6 @@ class Frontend extends dcNsProcess
|
||||
public static function init(): bool
|
||||
{
|
||||
static::$init = defined('ACTIVITY_REPORT')
|
||||
&& My::phpCompliant()
|
||||
&& My::isInstalled();
|
||||
|
||||
return static::$init;
|
||||
|
@ -31,7 +31,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;
|
||||
|
@ -38,7 +38,6 @@ class Manage extends dcNsProcess
|
||||
{
|
||||
static::$init = defined('DC_CONTEXT_ADMIN')
|
||||
&& defined('ACTIVITY_REPORT')
|
||||
&& My::phpCompliant()
|
||||
&& dcCore::app()->auth?->check(dcCore::app()->auth->makePermissions([
|
||||
dcAuth::PERMISSION_ADMIN,
|
||||
]), dcCore::app()->blog?->id);
|
||||
|
11
src/My.php
11
src/My.php
@ -30,9 +30,6 @@ class My
|
||||
/** @var int Incremental version by breaking changes */
|
||||
public const COMPATIBILITY_VERSION = 3;
|
||||
|
||||
/** @var string Required php version */
|
||||
public const PHP_MIN = '7.4';
|
||||
|
||||
/**
|
||||
* This module id.
|
||||
*/
|
||||
@ -59,14 +56,6 @@ class My
|
||||
return dirname(__DIR__);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check this module PHP version compliant.
|
||||
*/
|
||||
public static function phpCompliant(): bool
|
||||
{
|
||||
return version_compare(phpversion(), self::PHP_MIN, '>=');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check is module is trully installed.
|
||||
*
|
||||
|
@ -26,7 +26,6 @@ class Prepend extends dcNsProcess
|
||||
public static function init(): bool
|
||||
{
|
||||
static::$init = defined('DC_RC_PATH')
|
||||
&& My::phpCompliant()
|
||||
&& My::isInstalled();
|
||||
|
||||
return static::$init;
|
||||
|
Loading…
Reference in New Issue
Block a user