enhancePostContent/src/Uninstall.php

78 lines
1.7 KiB
PHP
Raw Normal View History

2021-08-23 23:55:52 +00:00
<?php
2023-10-11 19:02:43 +00:00
2023-04-09 08:17:36 +00:00
declare(strict_types=1);
namespace Dotclear\Plugin\enhancePostContent;
2023-07-30 09:56:53 +00:00
use Dotclear\Core\Process;
use Dotclear\Plugin\Uninstaller\Uninstaller;
2023-04-09 08:17:36 +00:00
2023-10-11 19:02:43 +00:00
/**
* @brief enhancePostContent uninstall class.
* @ingroup enhancePostContent
*
* @author Jean-Christian Denis
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
2023-07-30 09:56:53 +00:00
class Uninstall extends Process
{
2023-04-09 08:17:36 +00:00
public static function init(): bool
{
2023-07-30 09:56:53 +00:00
return self::status(My::checkContext(My::UNINSTALL));
2023-04-09 08:17:36 +00:00
}
2021-08-23 23:55:52 +00:00
public static function process(): bool
2023-04-09 08:17:36 +00:00
{
2023-10-07 22:35:35 +00:00
if (!self::status()) {
2023-04-09 08:17:36 +00:00
return false;
}
2022-11-30 23:42:12 +00:00
Uninstaller::instance()
->addUserAction(
'settings',
'delete_all',
My::id()
)
->addUserAction(
'tables',
'delete',
2023-10-11 19:02:43 +00:00
Epc::TABLE_NAME
)
->addUserAction(
'plugins',
'delete',
My::id()
)
->addUserAction(
'versions',
'delete',
My::id()
)
->addDirectAction(
'settings',
'delete_all',
My::id()
)
->addDirectAction(
'tables',
'delete',
2023-10-11 19:02:43 +00:00
Epc::TABLE_NAME
)
->addDirectAction(
'plugins',
'delete',
My::id()
)
->addDirectAction(
'versions',
'delete',
My::id()
)
;
2023-04-09 08:17:36 +00:00
2023-04-15 21:33:12 +00:00
// no custom action
return false;
2023-04-09 08:17:36 +00:00
}
}