|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
/* |
|
5
|
|
|
* You may not change or alter any portion of this comment or credits |
|
6
|
|
|
* of supporting developers from this source code or any supporting source code |
|
7
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
|
8
|
|
|
* |
|
9
|
|
|
* This program is distributed in the hope that it will be useful, |
|
10
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
12
|
|
|
*/ |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
|
16
|
|
|
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
|
17
|
|
|
* @author XOOPS Development Team |
|
18
|
|
|
*/ |
|
19
|
|
|
|
|
20
|
|
|
use XoopsModules\Gbook; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Prepares system prior to attempting to install module |
|
24
|
|
|
* @param \XoopsModule $module {@link XoopsModule} |
|
25
|
|
|
* |
|
26
|
|
|
* @return bool true if ready to install, false if not |
|
27
|
|
|
*/ |
|
28
|
|
|
function xoops_module_pre_install_gbook(\XoopsModule $module) |
|
29
|
|
|
{ |
|
30
|
|
|
$utility = new Gbook\Utility(); |
|
31
|
|
|
|
|
32
|
|
|
//check for minimum XOOPS version |
|
33
|
|
|
if (!$utility::checkVerXoops($module)) { |
|
34
|
|
|
return false; |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
// check for minimum PHP version |
|
38
|
|
|
if (!$utility::checkVerPhp($module)) { |
|
39
|
|
|
return false; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
$mod_tables = &$module->getInfo('tables'); |
|
43
|
|
|
foreach ($mod_tables as $table) { |
|
44
|
|
|
$GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
return true; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* Performs tasks required during installation of the module |
|
52
|
|
|
* @param \XoopsModule $module {@link XoopsModule} |
|
53
|
|
|
* |
|
54
|
|
|
* @return bool true if installation successful, false if not |
|
55
|
|
|
*/ |
|
56
|
|
|
function xoops_module_install_gbook(\XoopsModule $module) |
|
|
|
|
|
|
57
|
|
|
{ |
|
58
|
|
|
return true; |
|
59
|
|
|
} |
|
60
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.