fix static init

This commit is contained in:
Jean-Christian Denis 2023-03-26 21:04:37 +02:00
parent ca80bb69c7
commit f95ee36f69
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
4 changed files with 16 additions and 18 deletions

View file

@ -22,14 +22,14 @@ class Frontend extends dcNsProcess
{
public static function init(): bool
{
self::$init = defined('DC_RC_PATH');
static::$init = defined('DC_RC_PATH');
return self::$init;
return static::$init;
}
public static function process(): bool
{
if (!self::$init || !Utils::isActive()) {
if (!static::$init || !Utils::isActive()) {
return false;
}

View file

@ -22,14 +22,14 @@ class Install extends dcNsProcess
{
public static function init(): bool
{
self::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->newVersion(My::id(), dcCore::app()->plugins->moduleInfo(My::id(), 'version'));
static::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->newVersion(My::id(), dcCore::app()->plugins->moduleInfo(My::id(), 'version'));
return self::$init;
return static::$init;
}
public static function process(): bool
{
if (!self::$init) {
if (!static::$init) {
return false;
}

View file

@ -40,20 +40,18 @@ class Manage extends dcNsProcess
{
public static function init(): bool
{
if (defined('DC_CONTEXT_ADMIN')) {
dcPage::check(dcCore::app()->auth->makePermissions([
static::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->auth->check(
dcCore::app()->auth->makePermissions([
My::PERMISSION,
]));
]), dcCore::app()->blog->id
);
self::$init = true;
}
return self::$init;
return static::$init;
}
public static function process(): bool
{
if (!self::$init) {
if (!static::$init) {
return false;
}
@ -155,7 +153,7 @@ class Manage extends dcNsProcess
public static function render(): void
{
if (!self::$init) {
if (!static::$init) {
return;
}

View file

@ -21,14 +21,14 @@ class Prepend extends dcNsProcess
{
public static function init(): bool
{
self::$init = true;
static::$init = true;
return self::$init;
return static::$init;
}
public static function process(): bool
{
if (!self::$init) {
if (!static::$init) {
return false;
}