1
|
|
|
<?php |
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
|
|
|
/** |
14
|
|
|
* |
15
|
|
|
* @package XoopsModules\Pedigree |
16
|
|
|
* @author XOOPS Development Team <https://xoops.org> |
17
|
|
|
* @copyright {@link https://xoops.org/ XOOPS Project} |
18
|
|
|
* @license GPL 2.0 or later |
19
|
|
|
* @link https://xoops.org/ |
20
|
|
|
*/ |
21
|
|
|
|
22
|
|
|
use XoopsModules\Pedigree\{ |
23
|
|
|
Common\Configurator, |
24
|
|
|
Helper, |
25
|
|
|
Utility |
26
|
|
|
}; |
27
|
|
|
|
28
|
|
|
require \dirname(__DIR__) . '/preloads/autoloader.php'; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Prepares system prior to attempting to uninstall module |
32
|
|
|
* @param \XoopsModule $module {@link XoopsModule} |
33
|
|
|
* |
34
|
|
|
* @return bool true if ready to uninstall, false if not |
35
|
|
|
*/ |
36
|
|
|
function xoops_module_pre_uninstall_pedigree(\XoopsModule $module): bool |
|
|
|
|
37
|
|
|
{ |
38
|
|
|
// Do some synchronization if needed |
39
|
|
|
return true; |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Performs tasks required during uninstallation of the module |
44
|
|
|
* @param \XoopsModule $module {@link XoopsModule} |
45
|
|
|
* |
46
|
|
|
* @return bool true if uninstallation successful, false if not |
47
|
|
|
*/ |
48
|
|
|
function xoops_module_uninstall_pedigree(\XoopsModule $module): bool |
|
|
|
|
49
|
|
|
{ |
50
|
|
|
$moduleDirName = basename(\dirname(__DIR__)); |
51
|
|
|
$moduleDirNameUpper = mb_strtoupper($moduleDirName); //$capsDirName |
|
|
|
|
52
|
|
|
|
53
|
|
|
$helper = Helper::getInstance(); |
54
|
|
|
$configurator = new Configurator(); |
55
|
|
|
|
56
|
|
|
// $configurator = new Pedigree\Common\Configurator(); |
57
|
|
|
|
58
|
|
|
// Load language files |
59
|
|
|
$helper->loadLanguage('admin'); |
60
|
|
|
$helper->loadLanguage('common'); |
61
|
|
|
$success = true; |
62
|
|
|
|
63
|
|
|
//------------------------------------------------------------------ |
64
|
|
|
// Remove uploads folder (and all subfolders) if they exist |
65
|
|
|
//------------------------------------------------------------------ |
66
|
|
|
if (0 < count($configurator->uploadFolders)) { |
67
|
|
|
foreach (array_keys($configurator->uploadFolders) as $i) { |
68
|
|
|
$success = $success && Utility::deleteDirectory($configurator->uploadFolders[$i]); |
69
|
|
|
} |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
return $success; |
73
|
|
|
//------------ END ---------------- |
74
|
|
|
} |
75
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.