2021-09-02 22:04:20 +00:00
|
|
|
<?php
|
2023-10-17 20:47:35 +00:00
|
|
|
|
2023-04-20 12:22:43 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Dotclear\Plugin\activityReport;
|
2021-09-02 22:04:20 +00:00
|
|
|
|
2023-08-17 14:25:19 +00:00
|
|
|
use Dotclear\Core\Process;
|
2023-04-20 12:22:43 +00:00
|
|
|
use Dotclear\Plugin\Uninstaller\Uninstaller;
|
2021-09-02 22:04:20 +00:00
|
|
|
|
2023-04-20 12:22:43 +00:00
|
|
|
/**
|
2023-10-17 20:47:35 +00:00
|
|
|
* @brief activityReport uninstall class.
|
|
|
|
* @ingroup activityReport
|
2023-04-20 12:22:43 +00:00
|
|
|
*
|
2023-10-17 20:47:35 +00:00
|
|
|
* @author Jean-Christian Denis (author)
|
|
|
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
2023-04-20 12:22:43 +00:00
|
|
|
*/
|
2023-08-17 14:25:19 +00:00
|
|
|
class Uninstall extends Process
|
2023-04-20 12:22:43 +00:00
|
|
|
{
|
|
|
|
public static function init(): bool
|
|
|
|
{
|
2023-08-17 14:25:19 +00:00
|
|
|
return self::status(My::checkContext(My::UNINSTALL));
|
2023-04-20 12:22:43 +00:00
|
|
|
}
|
2021-09-02 22:04:20 +00:00
|
|
|
|
2023-04-20 12:22:43 +00:00
|
|
|
public static function process(): bool
|
|
|
|
{
|
2023-10-17 20:47:35 +00:00
|
|
|
if (!self::status()) {
|
2023-04-20 12:22:43 +00:00
|
|
|
return false;
|
|
|
|
}
|
2021-09-02 22:04:20 +00:00
|
|
|
|
2023-04-20 12:22:43 +00:00
|
|
|
Uninstaller::instance()
|
|
|
|
->addUserAction(
|
|
|
|
'tables',
|
|
|
|
'delete',
|
|
|
|
My::ACTIVITY_TABLE_NAME
|
|
|
|
)
|
|
|
|
->addUserAction(
|
|
|
|
'settings',
|
|
|
|
'delete_all',
|
|
|
|
My::id()
|
|
|
|
)
|
|
|
|
->addUserAction(
|
|
|
|
'versions',
|
|
|
|
'delete',
|
|
|
|
My::id()
|
|
|
|
)
|
|
|
|
->addUserAction(
|
|
|
|
'plugins',
|
|
|
|
'delete',
|
|
|
|
My::id()
|
|
|
|
)
|
|
|
|
->addDirectAction(
|
|
|
|
'tables',
|
|
|
|
'delete',
|
|
|
|
My::ACTIVITY_TABLE_NAME
|
|
|
|
)
|
|
|
|
->addDirectAction(
|
|
|
|
'settings',
|
|
|
|
'delete_all',
|
|
|
|
My::id()
|
|
|
|
)
|
|
|
|
->addDirectAction(
|
|
|
|
'versions',
|
|
|
|
'delete',
|
|
|
|
My::id()
|
|
|
|
)
|
|
|
|
->addDirectAction(
|
|
|
|
'plugins',
|
|
|
|
'delete',
|
|
|
|
My::id()
|
|
|
|
)
|
|
|
|
;
|
2021-09-02 22:04:20 +00:00
|
|
|
|
2023-04-20 12:22:43 +00:00
|
|
|
// no custom action
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|