cinecturlink2/src/Uninstall.php

77 lines
1.7 KiB
PHP
Raw Normal View History

2021-09-07 12:33:18 +00:00
<?php
2023-10-15 18:49:39 +00:00
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 Dotclear\Core\Process;
use Dotclear\Plugin\Uninstaller\Uninstaller;
2021-09-07 12:33:18 +00:00
2023-10-15 18:49:39 +00:00
/**
* @brief cinecturlink2 uninstall class.
* @ingroup cinecturlink2
*
* @author Jean-Christian Denis (author)
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
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
{
2023-10-15 18:49:39 +00:00
if (!self::status()) {
2023-08-24 11:55:44 +00:00
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;
}
}