|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace XoopsModules\Xoopspoll\Common; |
|
4
|
|
|
|
|
5
|
|
|
/* |
|
6
|
|
|
You may not change or alter any portion of this comment or credits |
|
7
|
|
|
of supporting developers from this source code or any supporting source code |
|
8
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
|
9
|
|
|
|
|
10
|
|
|
This program is distributed in the hope that it will be useful, |
|
11
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
13
|
|
|
*/ |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
|
17
|
|
|
* @license http://www.fsf.org/copyleft/gpl.html GNU public license |
|
18
|
|
|
* @author mamba <[email protected]> |
|
19
|
|
|
*/ |
|
20
|
|
|
trait ServerStats |
|
21
|
|
|
{ |
|
22
|
|
|
/** |
|
23
|
|
|
* serverStats() |
|
24
|
|
|
* |
|
25
|
|
|
* @return string |
|
26
|
|
|
*/ |
|
27
|
|
|
public static function getServerStats() |
|
28
|
|
|
{ |
|
29
|
|
|
//mb $wfdownloads = WfdownloadsWfdownloads::getInstance(); |
|
30
|
|
|
$moduleDirName = \basename(dirname(__DIR__, 2)); |
|
31
|
|
|
$moduleDirNameUpper = mb_strtoupper($moduleDirName); |
|
32
|
|
|
\xoops_loadLanguage('common', $moduleDirName); |
|
33
|
|
|
$html = ''; |
|
34
|
|
|
// $sql = 'SELECT metavalue'; |
|
35
|
|
|
// $sql .= ' FROM ' . $GLOBALS['xoopsDB']->prefix('wfdownloads_meta'); |
|
36
|
|
|
// $sql .= " WHERE metakey='version' LIMIT 1"; |
|
37
|
|
|
// $query = $GLOBALS['xoopsDB']->query($sql); |
|
38
|
|
|
// list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
|
39
|
|
|
$html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . \constant('CO_' . $moduleDirNameUpper . '_' . 'IMAGEINFO') . "</legend>\n"; |
|
40
|
|
|
$html .= "<div style='padding: 8px;'>\n"; |
|
41
|
|
|
// $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_' . 'METAVERSION') . $meta . "</div>\n"; |
|
42
|
|
|
// $html .= "<br>\n"; |
|
43
|
|
|
// $html .= "<br>\n"; |
|
44
|
|
|
$html .= '<div>' . \constant('CO_' . $moduleDirNameUpper . '_' . 'SPHPINI') . "</div>\n"; |
|
45
|
|
|
$html .= "<ul>\n"; |
|
46
|
|
|
|
|
47
|
|
|
$gdlib = \function_exists('gd_info') ? '<span style="color: #008000;">' . \constant('CO_' . $moduleDirNameUpper . '_' . 'GDON') . '</span>' : '<span style="color: #ff0000;">' . \constant('CO_' . $moduleDirNameUpper . '_' . 'GDOFF') . '</span>'; |
|
48
|
|
|
$html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_' . 'GDLIBSTATUS') . $gdlib; |
|
49
|
|
|
if (\function_exists('gd_info')) { |
|
50
|
|
|
if (true === ($gdlib = gd_info())) { |
|
51
|
|
|
$html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_' . 'GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
52
|
|
|
} |
|
53
|
|
|
} |
|
54
|
|
|
// |
|
55
|
|
|
// $safemode = ini_get('safe_mode') ? constant('CO_' . $moduleDirNameUpper . '_' . 'ON') . constant('CO_' . $moduleDirNameUpper . '_' . 'SAFEMODEPROBLEMS : constant('CO_' . $moduleDirNameUpper . '_' . 'OFF'); |
|
56
|
|
|
// $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_' . 'SAFEMODESTATUS . $safemode; |
|
57
|
|
|
// |
|
58
|
|
|
// $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_' . 'OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_' . 'ON') . '</span>'; |
|
59
|
|
|
// $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_' . 'REGISTERGLOBALS . $registerglobals; |
|
60
|
|
|
// |
|
61
|
|
|
$downloads = \ini_get('file_uploads') ? '<span style="color: #008000;">' . \constant('CO_' . $moduleDirNameUpper . '_' . 'ON') . '</span>' : '<span style="color: #ff0000;">' . \constant('CO_' . $moduleDirNameUpper . '_' . 'OFF') . '</span>'; |
|
62
|
|
|
$html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_' . 'SERVERUPLOADSTATUS') . $downloads; |
|
63
|
|
|
|
|
64
|
|
|
$html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_' . 'MAXUPLOADSIZE') . ' <b><span style="color: #0000ff;">' . \ini_get('upload_max_filesize') . "</span></b>\n"; |
|
65
|
|
|
$html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_' . 'MAXPOSTSIZE') . ' <b><span style="color: #0000ff;">' . \ini_get('post_max_size') . "</span></b>\n"; |
|
66
|
|
|
$html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_' . 'MEMORYLIMIT') . ' <b><span style="color: #0000ff;">' . \ini_get('memory_limit') . "</span></b>\n"; |
|
67
|
|
|
$html .= "</ul>\n"; |
|
68
|
|
|
$html .= "<ul>\n"; |
|
69
|
|
|
$html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_' . 'SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n"; |
|
70
|
|
|
$html .= "</ul>\n"; |
|
71
|
|
|
$html .= "<br>\n"; |
|
72
|
|
|
$html .= \constant('CO_' . $moduleDirNameUpper . '_' . 'UPLOADPATHDSC') . "\n"; |
|
73
|
|
|
$html .= '</div>'; |
|
74
|
|
|
$html .= '</fieldset><br>'; |
|
75
|
|
|
|
|
76
|
|
|
return $html; |
|
77
|
|
|
} |
|
78
|
|
|
} |
|
79
|
|
|
|