1
|
|
|
<?php declare(strict_types=1);
|
2
|
|
|
/*
|
3
|
|
|
You may not change or alter any portion of this comment or credits of
|
4
|
|
|
supporting developers from this source code or any supporting source code
|
5
|
|
|
which is considered copyrighted (c) material of the original comment or credit
|
6
|
|
|
authors.
|
7
|
|
|
|
8
|
|
|
This program is distributed in the hope that it will be useful, but
|
9
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
11
|
|
|
*/
|
12
|
|
|
|
13
|
|
|
/**
|
14
|
|
|
* XoopsFaq installation scripts
|
15
|
|
|
*
|
16
|
|
|
* @author Taiwen Jiang <[email protected]>
|
17
|
|
|
* @author ZySpec <[email protected]>
|
18
|
|
|
* @copyright https://xoops.org 2001-2017 XOOPS Project
|
19
|
|
|
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU Public License
|
20
|
|
|
* @link https://xoops.org XOOPS
|
21
|
|
|
* @since 1.25
|
22
|
|
|
*/
|
23
|
|
|
|
24
|
|
|
use XoopsModules\Xoopsfaq\{
|
25
|
|
|
Helper,
|
26
|
|
|
Utility
|
27
|
|
|
};
|
28
|
|
|
|
29
|
|
|
/**
|
30
|
|
|
* @internal {Make sure you PROTECT THIS FILE}
|
31
|
|
|
*/
|
32
|
|
|
if ((!defined('XOOPS_ROOT_PATH'))
|
33
|
|
|
|| !($GLOBALS['xoopsUser'] instanceof \XoopsUser)
|
34
|
|
|
|| !($GLOBALS['xoopsUser']->isAdmin())) {
|
35
|
|
|
exit('Restricted access' . PHP_EOL);
|
36
|
|
|
}
|
37
|
|
|
|
38
|
|
|
/**
|
39
|
|
|
* Prepares system prior to attempting to install module
|
40
|
|
|
*
|
41
|
|
|
*
|
42
|
|
|
* @return bool true if ready to install, false if not
|
43
|
|
|
*/
|
44
|
|
|
function xoops_module_pre_install_xoopsfaq(XoopsModule $module)
|
45
|
|
|
{
|
46
|
|
|
/** @var Utility $utilsClass */
|
47
|
|
|
$xoopsSuccess = Utility::checkVerXoops($module);
|
48
|
|
|
$phpSuccess = Utility::checkVerPhp($module);
|
49
|
|
|
|
50
|
|
|
return $xoopsSuccess && $phpSuccess;
|
51
|
|
|
}
|
52
|
|
|
|
53
|
|
|
/**
|
54
|
|
|
* Performs tasks required during installation of the module
|
55
|
|
|
*
|
56
|
|
|
* @param XoopsModule $module
|
57
|
|
|
*
|
58
|
|
|
* @return bool true if installation successful, false if not
|
59
|
|
|
*/
|
60
|
|
|
function xoops_module_install_xoopsfaq(\XoopsModule $module)
|
|
|
|
|
61
|
|
|
{
|
62
|
|
|
return true;
|
63
|
|
|
}
|
64
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.