diff --git a/src/Backend.php b/src/Backend.php index 5c25be3..30547fb 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -15,20 +15,18 @@ declare(strict_types=1); namespace Dotclear\Plugin\myBlogNumbers; 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 66a3511..7e1df30 100644 --- a/src/Frontend.php +++ b/src/Frontend.php @@ -15,20 +15,18 @@ declare(strict_types=1); namespace Dotclear\Plugin\myBlogNumbers; 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..a3d5e3e --- /dev/null +++ b/src/My.php @@ -0,0 +1,21 @@ +