cinecturlink2/src/Uninstall.php

81 lines
1.8 KiB
PHP
Raw Normal View History

2021-09-07 12:33:18 +00:00
<?php
2021-09-07 13:21:38 +00:00
/**
* @brief cinecturlink2, a plugin for Dotclear 2
2021-11-02 22:55:41 +00:00
*
2021-09-07 13:21:38 +00:00
* @package Dotclear
* @subpackage Plugin
2021-11-02 22:55:41 +00:00
*
2021-09-07 13:21:38 +00:00
* @author Jean-Christian Denis and Contributors
2021-11-02 22:55:41 +00:00
*
2021-09-07 13:21:38 +00:00
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
2023-08-24 11:55:44 +00:00
declare(strict_types=1);
2021-09-07 12:33:18 +00:00
2023-08-24 11:55:44 +00:00
namespace Dotclear\Plugin\cinecturlink2;
2021-09-07 12:33:18 +00:00
2023-08-24 11:55:44 +00:00
use dcCore;
use Dotclear\Core\Process;
use Dotclear\Plugin\Uninstaller\Uninstaller;
2021-09-07 12:33:18 +00:00
2023-08-24 11:55:44 +00:00
class Uninstall extends Process
{
public static function init(): bool
{
return self::status(My::checkContext(My::UNINSTALL));
}
2021-09-07 12:33:18 +00:00
2023-08-24 11:55:44 +00:00
public static function process(): bool
{
if (!self::status() || !dcCore::app()->plugins->moduleExists('Uninstaller')) {
return false;
}
2021-09-07 12:33:18 +00:00
2023-08-24 11:55:44 +00:00
Uninstaller::instance()
->addUserAction(
'settings',
'delete_all',
My::id()
)
->addUserAction(
My::id() . 'DeletePostsMeta',
'delete_all',
My::id()
)
->addUserAction(
'tables',
'delete',
My::CINECTURLINK_TABLE_NAME,
)
->addUserAction(
'tables',
'delete',
My::CATEGORY_TABLE_NAME,
)
->addUserAction(
'plugins',
'delete',
My::id()
)
->addUserAction(
'versions',
'delete',
My::id()
)
2021-09-07 12:33:18 +00:00
2023-08-24 11:55:44 +00:00
->addDirectAction(
'plugins',
'delete',
My::id()
)
->addDirectAction(
'versions',
'delete',
My::id()
)
;
2021-09-07 12:33:18 +00:00
2023-08-24 11:55:44 +00:00
return false;
}
}