Compare commits

...

2 Commits

Author SHA1 Message Date
Jean-Christian Paul Denis 0d7b97346a
cosmetic 2023-10-13 21:24:38 +02:00
Jean-Christian Paul Denis a21bbdd4a8
release 1.5 2023-10-13 21:23:56 +02:00
12 changed files with 128 additions and 117 deletions

View File

@ -1,3 +1,9 @@
dcAdvancedCleaner 1.5 - 2023.10.13
===========================================================
* Require Dotclear 2.28
* Require PHP 8.1
* Code review
dcAdvancedCleaner 1.4 - 2023.10.07 dcAdvancedCleaner 1.4 - 2023.10.07
=========================================================== ===========================================================
* Require Dotclear 2.28 * Require Dotclear 2.28

View File

@ -1,7 +1,7 @@
# README # README
[![Release](https://img.shields.io/badge/release-1.4-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/releases) [![Release](https://img.shields.io/badge/release-1.5-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/releases)
![Date](https://img.shields.io/badge/date-2023.10.07-c44d58.svg) ![Date](https://img.shields.io/badge/date-2023.10.13-c44d58.svg)
[![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download) [![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download)
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/dcAdvancedCleaner) [![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/dcAdvancedCleaner)
[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/src/branch/master/LICENSE) [![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/src/branch/master/LICENSE)
@ -14,10 +14,10 @@ _dcAdvancedCleaner_ is a plugin for the open-source web publishing software call
## REQUIREMENTS ## REQUIREMENTS
* Permissions superadmin
* Dotclear 2.28 * Dotclear 2.28
* PHP >= 8.1 * PHP 8.1+
* Plugin Uninstaller * Plugin Uninstaller
* Permissions superadmin
## USAGE ## USAGE
@ -32,7 +32,12 @@ Once it's done you can manage cleaners from menu
* License : [GNU GPL v2](https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html) * License : [GNU GPL v2](https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html)
* Source & contribution : [Gitea Page](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner) or [GitHub Page](https://github.com/JcDenis/dcAdvancedCleaner) * Source & contribution : [Gitea Page](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner) or [GitHub Page](https://github.com/JcDenis/dcAdvancedCleaner)
* Packages & details: [Gitea Page](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/releases) or [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/dcAdvancedCleaner) * Packages & details: [Gitea Page](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/releases) or [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/dcAdvancedCleaner)
* Discuss and help : [Dotclear Forum](https://forum.dotclear.org/viewtopic.php?id=40381)
* [License](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/src/branch/master/LICENSE)
* [Packages & details](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/releases) (or on [Dotaddict](https://plugins.dotaddict.org/dc2/details/dcAdvancedCleaner))
* [Sources & contributions](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner) (or on [GitHub](https://github.com/JcDenis/dcAdvancedCleaner))
* [Issues & security](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/issues) (or on [GitHub](https://github.com/JcDenis/dcAdvancedCleaner/issues))
* [Discuss & help](https://forum.dotclear.org/viewtopic.php?id=40381)
## CONTRIBUTORS ## CONTRIBUTORS

View File

@ -1,31 +1,30 @@
<?php <?php
/** /**
* @brief dcAdvancedCleaner, a plugin for Dotclear 2 * @file
* @brief The plugin dcAdvancedCleaner definition
* @ingroup dcAdvancedCleaner
* *
* @package Dotclear * @defgroup dcAdvancedCleaner Plugin dcAdvancedCleaner.
* @subpackage Plugin
* *
* @author Jean-Christian Denis and Contributors * Make a huge cleaning of dotclear.
* *
* @copyright Jean-Christian Denis * @author Jean-Christian Denis (author)
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/ */
if (!defined('DC_RC_PATH')) { declare(strict_types=1);
return null;
}
$this->registerModule( $this->registerModule(
'Advanced cleaner', 'Advanced cleaner',
'Make a huge cleaning of dotclear', 'Make a huge cleaning of dotclear',
'Jean-Christian Denis and Contributors', 'Jean-Christian Denis and Contributors',
'1.4', '1.5',
[ [
'requires' => [ 'requires' => [
['php', '8.1'],
['core', '2.28'], ['core', '2.28'],
['Uninstaller', '1.0'], ['Uninstaller', '1.0'],
], ],
'permissions' => null, 'permissions' => 'My',
'type' => 'plugin', 'type' => 'plugin',
'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues', 'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues',
'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md', 'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md',

View File

@ -2,10 +2,10 @@
<modules xmlns:da="http://dotaddict.org/da/"> <modules xmlns:da="http://dotaddict.org/da/">
<module id="dcAdvancedCleaner"> <module id="dcAdvancedCleaner">
<name>Advanced cleaner</name> <name>Advanced cleaner</name>
<version>1.4</version> <version>1.5</version>
<author>Jean-Christian Denis and Contributors</author> <author>Jean-Christian Denis and Contributors</author>
<desc>Make a huge cleaning of dotclear</desc> <desc>Make a huge cleaning of dotclear</desc>
<file>https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/releases/download/v1.4/plugin-dcAdvancedCleaner.zip</file> <file>https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/releases/download/v1.5/plugin-dcAdvancedCleaner.zip</file>
<da:dcmin>2.28</da:dcmin> <da:dcmin>2.28</da:dcmin>
<da:details>https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/src/branch/master/README.md</da:details> <da:details>https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/src/branch/master/README.md</da:details>
<da:support>https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/issues</da:support> <da:support>https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/issues</da:support>

View File

@ -1,16 +1,11 @@
<?php <?php
/** /**
* @brief dcAdvancedCleaner, a plugin for Dotclear 2 * @file
* @brief dcAdvancedCleaner resources helper.
* @ingroup dcAdvancedCleaner
* *
* @package Dotclear * @author Jean-Christian Denis (author)
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/ */
if (!defined('DC_RC_PATH')) { \Dotclear\App::backend()->resources()->set('help', 'dcAdvancedCleaner', __DIR__ . '/help/dcAdvancedCleaner.html');
return;
}
dcCore::app()->resources['help']['dcAdvancedCleaner'] = __DIR__ . '/help/dcAdvancedCleaner.html';

View File

@ -1,16 +1,11 @@
<?php <?php
/** /**
* @brief dcAdvancedCleaner, a plugin for Dotclear 2 * @file
* @brief dcAdvancedCleaner resources helper.
* @ingroup dcAdvancedCleaner
* *
* @package Dotclear * @author Jean-Christian Denis (author)
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/ */
if (!defined('DC_RC_PATH')) { \Dotclear\App::backend()->resources()->set('help', 'dcAdvancedCleaner', __DIR__ . '/help/dcAdvancedCleaner.html');
return;
}
dcCore::app()->resources['help']['dcAdvancedCleaner'] = __DIR__ . '/help/dcAdvancedCleaner.html';

View File

@ -1,15 +1,5 @@
<?php <?php
/**
* @brief dcAdvancedCleaner, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
declare(strict_types=1); declare(strict_types=1);
namespace Dotclear\Plugin\dcAdvancedCleaner; namespace Dotclear\Plugin\dcAdvancedCleaner;
@ -18,6 +8,13 @@ use Dotclear\App;
use Dotclear\Core\Process; use Dotclear\Core\Process;
use Dotclear\Core\Backend\Favorites; use Dotclear\Core\Backend\Favorites;
/**
* @brief dcAdvancedCleaner backend class.
* @ingroup dcAdvancedCleaner
*
* @author Jean-Christian Denis (author)
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
class Backend extends Process class Backend extends Process
{ {
public static function init(): bool public static function init(): bool

View File

@ -1,15 +1,5 @@
<?php <?php
/**
* @brief dcAdvancedCleaner, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
declare(strict_types=1); declare(strict_types=1);
namespace Dotclear\Plugin\dcAdvancedCleaner; namespace Dotclear\Plugin\dcAdvancedCleaner;
@ -35,6 +25,13 @@ use Dotclear\Helper\Html\Form\{
use Dotclear\Helper\Html\Html; use Dotclear\Helper\Html\Html;
use Exception; use Exception;
/**
* @brief dcAdvancedCleaner manage class.
* @ingroup dcAdvancedCleaner
*
* @author Jean-Christian Denis (author)
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
class Manage extends Process class Manage extends Process
{ {
public static function init(): bool public static function init(): bool

View File

@ -1,15 +1,5 @@
<?php <?php
/**
* @brief dcAdvancedCleaner, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
declare(strict_types=1); declare(strict_types=1);
namespace Dotclear\Plugin\dcAdvancedCleaner; namespace Dotclear\Plugin\dcAdvancedCleaner;
@ -21,27 +11,62 @@ use Dotclear\Plugin\Uninstaller\{
}; };
use Exception; use Exception;
/**
* @brief dcAdvancedCleaner vars definition class.
* @ingroup dcAdvancedCleaner
*
* @author Jean-Christian Denis (author)
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
class ManageVars class ManageVars
{ {
/** @var ManageVars self instance */ /**
* self instance.
*
* @var ManageVars $container
*/
private static $container; private static $container;
/** @var CleanersStack The cleaners stack */ /**
* The cleaners stack.
*
* @var CleanersStack $cleaners
*/
public readonly CleanersStack $cleaners; public readonly CleanersStack $cleaners;
/** @var null|CleanerParent The post form cleaner */ /**
* The post form cleaner.
*
* @var null|CleanerParent $cleaner
*/
public readonly ?CleanerParent $cleaner; public readonly ?CleanerParent $cleaner;
/** @var string $related The post form related action id */ /**
* The post form related action id.
*
* @var string $related
*/
public readonly string $related; public readonly string $related;
/** @var array<int,string> The post form selected ns */ /**
* The post form selected ns.
*
* @var array<int,string> $entries
*/
public readonly array $entries; public readonly array $entries;
/** @var string The post form action id */ /**
* The post form action id.
*
* @var string $action
*/
public readonly string $action; public readonly string $action;
/** @var array<string,string> The form actions combo */ /**
* The form actions combo.
*
* @var array<string,string> $combo
*/
public readonly array $combo; public readonly array $combo;
protected function __construct() protected function __construct()

View File

@ -1,15 +1,5 @@
<?php <?php
/**
* @brief dcAdvancedCleaner, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
declare(strict_types=1); declare(strict_types=1);
namespace Dotclear\Plugin\dcAdvancedCleaner; namespace Dotclear\Plugin\dcAdvancedCleaner;
@ -17,10 +7,18 @@ namespace Dotclear\Plugin\dcAdvancedCleaner;
use Dotclear\App; use Dotclear\App;
use Dotclear\Module\MyPlugin; use Dotclear\Module\MyPlugin;
/**
* @brief dcAdvancedCleaner My helper.
* @ingroup dcAdvancedCleaner
*
* @author Jean-Christian Denis (author)
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
class My extends MyPlugin class My extends MyPlugin
{ {
public static function checkCustomContext(int $context): ?bool public static function checkCustomContext(int $context): ?bool
{ {
return $context === self::PREPEND ? App::auth()->isSuperAdmin() : null; // Limit to backend and super admin
return App::task()->checkContext('BACKEND') && App::auth()->isSuperAdmin();
} }
} }

View File

@ -1,15 +1,5 @@
<?php <?php
/**
* @brief dcAdvancedCleaner, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
declare(strict_types=1); declare(strict_types=1);
namespace Dotclear\Plugin\dcAdvancedCleaner; namespace Dotclear\Plugin\dcAdvancedCleaner;
@ -22,6 +12,13 @@ use Dotclear\Plugin\activityReport\{
}; };
use Dotclear\Plugin\Uninstaller\Uninstaller; use Dotclear\Plugin\Uninstaller\Uninstaller;
/**
* @brief dcAdvancedCleaner prepend class.
* @ingroup dcAdvancedCleaner
*
* @author Jean-Christian Denis (author)
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
class Prepend extends Process class Prepend extends Process
{ {
public static function init(): bool public static function init(): bool

View File

@ -1,15 +1,5 @@
<?php <?php
/**
* @brief dcAdvancedCleaner, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
declare(strict_types=1); declare(strict_types=1);
namespace Dotclear\Plugin\dcAdvancedCleaner; namespace Dotclear\Plugin\dcAdvancedCleaner;
@ -17,6 +7,13 @@ namespace Dotclear\Plugin\dcAdvancedCleaner;
use Dotclear\Core\Process; use Dotclear\Core\Process;
use Dotclear\Plugin\Uninstaller\Uninstaller; use Dotclear\Plugin\Uninstaller\Uninstaller;
/**
* @brief dcAdvancedCleaner uninstall class.
* @ingroup dcAdvancedCleaner
*
* @author Jean-Christian Denis (author)
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
class Uninstall extends Process class Uninstall extends Process
{ {
public static function init(): bool public static function init(): bool