forked from OwlManAtt/kittokittokitto
-
Notifications
You must be signed in to change notification settings - Fork 1
/
system_check.php
162 lines (140 loc) · 7.09 KB
/
system_check.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?php
/**
* A quick system check to ensure that your server is
* Kitto-compatible.
*
* This file is part of 'Kitto_Kitto_Kitto'.
*
* 'Kitto_Kitto_Kitto' is free software; you can redistribute
* it and/or modify it under the terms of the GNU
* General Public License as published by the Free
* Software Foundation; either version 3 of the License,
* or (at your option) any later version.
*
* 'Kitto_Kitto_Kitto' is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General
* Public License along with 'Kitto_Kitto_Kitto'; if not,
* write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @author Nicholas 'Owl' Evans <[email protected]>
* @copyright Nicolas Evans, 2007
* @license http://www.gnu.org/licenses/gpl-3.0.txt GPLv3
* @package Kitto_Kitto_Kitto
* @subpackage Core
* @version 1.0.0
**/
// Better yellow for white BG.
$yellow = '#9F8300';
$php_version = PHP_VERSION;
$version_compatible = version_compare('5.0.0',$php_version,'<=');
// Required modules.
$MODULES = array(
'GD' => extension_loaded('gd'),
'MySQL' => extension_loaded('mysql'),
'PCRE' => extension_loaded('pcre'),
'Sessions' => extension_loaded('session'),
);
// Warnings.
$WARNING = array(
'register_globals' => array(
'value' => ( ini_get('register_globals') == false ? true : false ),
'help' => "Register_globals being turned on is considered bad practice. You <em>should</em> add ini_set('register_globals','Off'); to your Kitto config file after you successfully complete the installation.",
),
'display_errors' => array(
'value' => ini_get('display_errors'),
'help' => "PHP errors will not be sent to the screen - only to an error_log somewhere on your server. This may be a major inconvenience to you as your set Kitto up. If you have problems with a blank white screen, you are probably getting PHP errors, and they are being surpressed. Add ini_set('display_errors','On'); to your Kitto config file to address this.",
),
);
$INFO = array(
'Base Directory' => str_replace('/system_check.php',null,$_SERVER['SCRIPT_FILENAME']),
);
$content = "<?xml version=\"1.0\"?>\n";
$content .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
$content .= "<html>\n";
$content .= "<head>\n";
$content .= "<meta http-equiv='Content-type' content='text/html; charset=UTF-8' />\n";
$content .= "<title>Modular Gaming System Check</title>\n";
$content .= "</head>\n";
$content .= "<body>\n";
$content .= "<p>Any 'status' fields marked in <span style='color: red;'>red</span> indicate that you have a serious problem
and it must be addressed for Modular Gaming to work. <span style='color: $yellow;'>Yellow</span> 'status' fields indicate a warning -
Modular Gaming will
work, but you probably want to take the suggested corrective action. <span style='color: green;'>Green</span> means OK. The base directory is provided here for your reference - you need it during installation.</p>\n";
$content .= "<p>Make sure you visit the <a href='http://modulargaming.com'>Modular Gaming</a> site often - new releases, news,
and developer guides are available there.</p>\n";
$content .= "<p>If everything looks green, you can proceed with <a
href='http://modulargaming.com/projects/modulargaming/wiki/Install'>installing Modular Gaming</a>.</p>\n";
$content .= "<div align='center'>\n";
$content .= "<table style='border: 1px solid black; border-collapse: collapse;' width='50%' border='1' cellpadding='5'>\n";
$content .= "<tr>\n";
$content .= "<td colspan='2' align='center' style='font-weight: bold; font-size: large;'>Modular Gaming System Check</td>\n";
$content .= "</tr>\n";
$content .= "<tr>\n";
$content .= "<td align='center' style='font-weight: bold;' width='50%'>Setting</td>\n";
$content .= "<td align='center' style='font-weight: bold;' width='50%'>Status</td>\n";
$content .= "</tr>\n";
$content .= "<tr>\n";
$content .= "<td>PHP Version</td>\n";
$content .= "<td>\n";
$color = 'green';
if($version_compatible == false)
{
$color = 'red';
}
$content .= "<span style='color: $color'>$php_version</span>";
$content .= "</td>\n";
$content .= "</tr>\n";
foreach($MODULES as $module => $status)
{
$content .= "<tr>\n";
$content .= "<td>Extension - $module</td>\n";
$content .= "<td>\n";
$color = 'green';
$status = 'Installed';
if($status == false)
{
$color = 'red';
$status = 'Not Installed';
}
$content .= "<span style='color: $color'>$status</span>";
$content .= "</td>\n";
$content .= "</tr>\n";
} // end modules loop
foreach($WARNING as $option => $STUFF)
{
$content .= "<tr>\n";
$content .= "<td>Option $option</td>\n";
$content .= "<td>\n";
$color = 'green';
$status = 'OK';
if($STUFF['value'] == false)
{
$color = $yellow;
$status = $STUFF['help'];
}
$content .= "<span style='color: $color'>$status</span>";
$content .= "</td>\n";
$content .= "</tr>\n";
} // end modules loop
foreach($INFO as $label => $data)
{
$content .= "<tr>\n";
$content .= "<td>$label</td>\n";
$content .= "<td>\n";
$color = 'green';
$content .= "<span style='color: $color'>$data</span>";
$content .= "</td>\n";
$content .= "</tr>\n";
} // end modules loop
$content .= "</table>\n";
$content .= "</div>\n";
$content .= "</body>\n";
$content .= "</html>\n";
print $content;
?>