1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
You may not change or alter any portion of this comment or credits |
5
|
|
|
of supporting developers from this source code or any supporting source code |
6
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
7
|
|
|
|
8
|
|
|
This program is distributed in the hope that it will be useful, |
9
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
10
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
11
|
|
|
*/ |
12
|
|
|
/** |
13
|
|
|
* uninstall.php - cleanup on module uninstall |
14
|
|
|
* |
15
|
|
|
* @author XOOPS Module Development Team |
16
|
|
|
* @copyright {@link https://xoops.org 2001-2016 XOOPS Project} |
17
|
|
|
* @license {@link GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)} |
18
|
|
|
* @link https://xoops.org XOOPS |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
use XoopsModules\Publisher\{ |
22
|
|
|
Helper, |
23
|
|
|
Utility |
24
|
|
|
}; |
25
|
|
|
/** @var Helper $helper */ |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Prepares system prior to attempting to uninstall module |
29
|
|
|
* @param XoopsModule $module {@link XoopsModule} |
30
|
|
|
* |
31
|
|
|
* @return bool true if ready to uninstall, false if not |
32
|
|
|
*/ |
33
|
|
|
function xoops_module_pre_uninstall_publisher(\XoopsModule $module): bool |
|
|
|
|
34
|
|
|
{ |
35
|
|
|
// Do some synchronization if needed |
36
|
|
|
return true; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Performs tasks required during uninstallation of the module |
41
|
|
|
* @param XoopsModule $module {@link XoopsModule} |
42
|
|
|
* |
43
|
|
|
* @return bool true if uninstallation successful, false if not |
44
|
|
|
*/ |
45
|
|
|
function xoops_module_uninstall_publisher(\XoopsModule $module): bool |
|
|
|
|
46
|
|
|
{ |
47
|
|
|
//clean Cache |
48
|
|
|
Utility::cleanCache(); |
49
|
|
|
|
50
|
|
|
// Rename uploads folder to BAK and add date to name |
51
|
|
|
$success = Utility::renameUploadFolder(); |
52
|
|
|
|
53
|
|
|
return $success; |
54
|
|
|
} |
55
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.