From f46c9c8d5299d6aab4434c31f243d8473f8dc5b2 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sun, 13 Aug 2023 01:07:30 +0200 Subject: [PATCH] upgrade to Dotclear 2.27 --- src/Backend.php | 10 ++++------ src/Frontend.php | 10 ++++------ src/My.php | 21 +++++++++++++++++++++ 3 files changed, 29 insertions(+), 12 deletions(-) create mode 100644 src/My.php diff --git a/src/Backend.php b/src/Backend.php index 0c3ea96..d661960 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -15,20 +15,18 @@ declare(strict_types=1); namespace Dotclear\Plugin\lastBlogUpdate; use dcCore; -use dcNsProcess; +use Dotclear\Core\Process; -class Backend extends dcNsProcess +class Backend extends Process { public static function init(): bool { - static::$init = defined('DC_CONTEXT_ADMIN'); - - return static::$init; + return self::status(My::checkContext(My::BACKEND)); } public static function process(): bool { - if (!static::$init) { + if (!self::status()) { return false; } diff --git a/src/Frontend.php b/src/Frontend.php index c5d9411..91b9cbc 100644 --- a/src/Frontend.php +++ b/src/Frontend.php @@ -15,20 +15,18 @@ declare(strict_types=1); namespace Dotclear\Plugin\lastBlogUpdate; use dcCore; -use dcNsProcess; +use Dotclear\Core\Process; -class Frontend extends dcNsProcess +class Frontend extends Process { public static function init(): bool { - static::$init = true; - - return static::$init; + return self::status(My::checkContext(My::FRONTEND)); } public static function process(): bool { - if (!static::$init) { + if (!self::status()) { return false; } diff --git a/src/My.php b/src/My.php new file mode 100644 index 0000000..37b12aa --- /dev/null +++ b/src/My.php @@ -0,0 +1,21 @@ +