From 46b22e1e0c6271055de4f0f60aabcb0c3f789900 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 29 Jul 2023 11:04:22 +0200 Subject: [PATCH] release 2023.07.29 --- CHANGELOG.md | 5 +++++ README.md | 5 +++-- _define.php | 6 +++--- dcstore.xml | 6 +++--- src/Backend.php | 10 ++++------ src/Frontend.php | 10 ++++------ src/My.php | 21 +++++++++++++++++++++ src/Prepend.php | 10 ++++------ 8 files changed, 47 insertions(+), 26 deletions(-) create mode 100644 src/My.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 43c790b..d6e8a1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +2023.07.29 +- require Dotclear 2.27 +- require PHP 7.4+ +- update to Dotclear 2.27-dev + 2023.04.23 - require Dotclear 2.26 - use latest dotclear namespace diff --git a/README.md b/README.md index cdc756e..c27c3a7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Release](https://img.shields.io/github/v/release/JcDenis/simplyFavicon)](https://github.com/JcDenis/simplyFavicon/releases) [![Date](https://img.shields.io/github/release-date/JcDenis/simplyFavicon)](https://github.com/JcDenis/simplyFavicon/releases) [![Issues](https://img.shields.io/github/issues/JcDenis/simplyFavicon)](https://github.com/JcDenis/simplyFavicon/issues) -[![Dotclear](https://img.shields.io/badge/dotclear-v2.26-blue.svg)](https://fr.dotclear.org/download) +[![Dotclear](https://img.shields.io/badge/dotclear-v2.27-blue.svg)](https://fr.dotclear.org/download) [![Dotaddict](https://img.shields.io/badge/dotaddict-official-green.svg)](https://plugins.dotaddict.org/dc2/details/simplyFavicon) [![License](https://img.shields.io/github/license/JcDenis/simplyFavicon)](https://github.com/JcDenis/simplyFavicon/blob/master/LICENSE) @@ -19,7 +19,8 @@ It adds a favicon to your blog. _simplyFavicon_ requires: * Administrator permissions - * Dotclear 2.26 + * Dotclear 2.27 + * PHP 7.4+ * A readable public directory. ## USAGE diff --git a/_define.php b/_define.php index 80d6125..cb12f8f 100644 --- a/_define.php +++ b/_define.php @@ -10,7 +10,7 @@ * @copyright Jean-Christian Denis * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html */ -if (!defined('DC_RC_PATH') || is_null(dcCore::app()->auth)) { +if (!defined('DC_RC_PATH')) { return; } @@ -18,9 +18,9 @@ $this->registerModule( 'Simply favicon', 'Multi-agents favicon', 'Jean-Christian Denis', - '2023.04.23', + '2023.07.29', [ - 'requires' => [['core', '2.26']], + 'requires' => [['core', '2.27']], 'permissions' => dcCore::app()->auth->makePermissions([ dcCore::app()->auth::PERMISSION_ADMIN, ]), diff --git a/dcstore.xml b/dcstore.xml index b3f8665..3dfc682 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -2,11 +2,11 @@ Simply favicon - 2023.04.23 + 2023.07.29 Jean-Christian Denis Multi-agents favicon - https://github.com/JcDenis/simplyFavicon/releases/download/v2023.04.23/plugin-simplyFavicon.zip - 2.26 + https://github.com/JcDenis/simplyFavicon/releases/download/v2023.07.29/plugin-simplyFavicon.zip + 2.27 http://plugins.dotaddict.org/dc2/details/simplyFavicon https://github.com/JcDenis/simplyFavicon diff --git a/src/Backend.php b/src/Backend.php index 8a45b45..1a822dd 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -15,8 +15,8 @@ declare(strict_types=1); namespace Dotclear\Plugin\simplyFavicon; use dcCore; -use dcNsProcess; use dcSettings; +use Dotclear\Core\Process; use Dotclear\Helper\File\Path; use Dotclear\Helper\Html\Form\{ Checkbox, @@ -26,18 +26,16 @@ use Dotclear\Helper\Html\Form\{ Para }; -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 b6b4179..8deb107 100644 --- a/src/Frontend.php +++ b/src/Frontend.php @@ -15,21 +15,19 @@ declare(strict_types=1); namespace Dotclear\Plugin\simplyFavicon; use dcCore; -use dcNsProcess; +use Dotclear\Core\Process; use Dotclear\Helper\File\Path; -class Frontend extends dcNsProcess +class Frontend extends Process { public static function init(): bool { - static::$init = defined('DC_RC_PATH'); - - 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..4a6e9a1 --- /dev/null +++ b/src/My.php @@ -0,0 +1,21 @@ +