From f155a33fb1218d4ff5dfe2b9d9b3c5b45d7d270e Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Fri, 20 Jan 2023 21:54:39 +0100 Subject: [PATCH] testing NsClass --- _admin.php | 18 ---------------- _config.php | 19 ----------------- _define.php | 2 +- _install.php | 20 ------------------ _prepend.php | 22 ------------------- _uninstall.php | 24 --------------------- inc/Admin.php | 6 +++--- inc/Config.php | 20 ++++++++---------- inc/Install.php | 6 +++--- inc/Manage.php | 14 +++++++------ inc/Prepend.php | 56 ------------------------------------------------- index.php | 19 ----------------- 12 files changed, 24 insertions(+), 202 deletions(-) delete mode 100644 _admin.php delete mode 100644 _config.php delete mode 100644 _install.php delete mode 100644 _prepend.php delete mode 100644 _uninstall.php delete mode 100644 inc/Prepend.php delete mode 100644 index.php diff --git a/_admin.php b/_admin.php deleted file mode 100644 index c4e18d9..0000000 --- a/_admin.php +++ /dev/null @@ -1,18 +0,0 @@ -registerModule( 'pacKman', 'Manage your Dotclear packages', 'Jean-Christian Denis', - '2023.01.07', + '2023.01.09-dev', [ 'requires' => [['core', '2.24']], 'permissions' => null, diff --git a/_install.php b/_install.php deleted file mode 100644 index aa29807..0000000 --- a/_install.php +++ /dev/null @@ -1,20 +0,0 @@ -admin->__get('list')->getURL('module=' . self::$pid . '&conf=1&redir=' . dcCore::app()->admin->__get('list')->getRedir()) ); - - return true; } } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); } - return null; + return true; } - public static function render() + public static function render(): void { if (!self::$init) { - return false; + return; } # -- Get settings -- diff --git a/inc/Install.php b/inc/Install.php index 1919a55..dc4e97a 100644 --- a/inc/Install.php +++ b/inc/Install.php @@ -17,11 +17,12 @@ namespace Dotclear\Plugin\pacKman; /* dotclear ns */ use dcCore; use dcNamespace; +use dcNsProcess; /* php ns */ use Exception; -class Install +class Install extends dcNsProcess { // Module specs private static $mod_conf = [ @@ -71,7 +72,6 @@ class Install // Nothing to change below private static $pid = ''; - protected static $init = false; public static function init(): bool { @@ -81,7 +81,7 @@ class Install return self::$init; } - public static function process(): ?bool + public static function process(): bool { if (!self::$init) { return false; diff --git a/inc/Manage.php b/inc/Manage.php index 368e5f3..cc12400 100644 --- a/inc/Manage.php +++ b/inc/Manage.php @@ -18,6 +18,7 @@ namespace Dotclear\Plugin\pacKman; use dcCore; use dcPage; use dcThemes; +use dcNsProcess; /* clearbricks ns */ use files; @@ -27,12 +28,11 @@ use path; /* php ns */ use Exception; -class Manage +class Manage extends dcNsProcess { private static $plugins_path = ''; private static $themes_path = ''; private static $pid = ''; - protected static $init = false; public static function init(): bool { @@ -51,10 +51,10 @@ class Manage return self::$init; } - public static function process(): void + public static function process(): bool { if (!self::$init) { - return; + return false; } # Queries @@ -279,12 +279,14 @@ class Manage } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); } + + return true; } - public static function render() + public static function render(): void { if (!self::$init) { - return false; + return; } # Settings diff --git a/inc/Prepend.php b/inc/Prepend.php deleted file mode 100644 index 6abe79b..0000000 --- a/inc/Prepend.php +++ /dev/null @@ -1,56 +0,0 @@ -autoload([ - __NAMESPACE__ . '\\' . $lib => __DIR__ . DIRECTORY_SEPARATOR . $lib . '.php', - ]); - } - - return true; - } -} diff --git a/index.php b/index.php deleted file mode 100644 index 0cdebae..0000000 --- a/index.php +++ /dev/null @@ -1,19 +0,0 @@ -