46 global $TEXT, $HEADING, $MESSAGE;
53 $temp_path = LEPTON_PATH .
'/temp/unzip';
57 if (!file_exists($temp_path .
'/precheck.php')) {
65 require $temp_path .
'/precheck.php';
68 if (!(isset($PRECHECK) ))
77 foreach ($PRECHECK as $key => $value)
82 case 'LEPTON_VERSION':
83 if (isset($value[
'VERSION']))
86 $operator = (isset($value[
'OPERATOR']) && trim($value[
'OPERATOR']) !=
'') ? $value[
'OPERATOR'] :
'>=';
88 $status =
versionCompare(LEPTON_VERSION, $value[
'VERSION'], $operator);
90 'check' => sprintf(
'LEPTON-%s: ', $TEXT[
'VERSION']),
91 'required' => sprintf(
'%s %s', $operator, $value[
'VERSION']),
92 'actual' => LEPTON_VERSION,
104 foreach( $PRECHECK[
'ADDONS'] as $addon => $values)
106 if (is_array($values))
109 $version = (isset($values[
'VERSION']) && trim($values[
'VERSION']) !=
'') ? $values[
'VERSION'] :
'';
110 $operator = (isset($values[
'OPERATOR']) && trim($values[
'OPERATOR']) !=
'') ? $values[
'OPERATOR'] :
'>=';
115 $addon = strip_tags($values);
123 "SELECT * from ".TABLE_PREFIX.
"addons WHERE directory = '".addslashes($addon).
"' ",
130 $addon_status = $TEXT[
'NOT_INSTALLED'];
134 $addon_status = $TEXT[
'INSTALLED'];
139 $status =
versionCompare($aAddon[
'version'], $version, $operator);
140 $addon_status = $aAddon[
'version'];
146 'check' =>
' ' . $TEXT[
'ADDON'] .
': ' . $addon,
147 'required' => ($version !=
'') ? $operator .
' ' . $version : $TEXT[
'INSTALLED'],
148 'actual' => $addon_status,
162 if (isset($value[
'VERSION']))
165 $operator = (isset($value[
'OPERATOR']) && trim($value[
'OPERATOR']) !=
'') ? $value[
'OPERATOR'] :
'>=';
168 $status =
versionCompare(PHP_VERSION, $value[
'VERSION'], $operator);
170 'check' =>
'PHP-' . $TEXT[
'VERSION'] .
': ',
171 'required' => $operator .
' ' . $value[
'VERSION'],
172 'actual' => PHP_VERSION,
184 case 'PHP_EXTENSIONS':
185 if (is_array($PRECHECK[
'PHP_EXTENSIONS']))
187 foreach ($PRECHECK[
'PHP_EXTENSIONS'] as $extension)
189 $status = extension_loaded(strtolower($extension));
191 'check' =>
' ' . $TEXT[
'EXTENSION'] .
': ' . $extension,
192 'required' => $TEXT[
'INSTALLED'],
193 'actual' => ($status) ? $TEXT[
'INSTALLED'] : $TEXT[
'NOT_INSTALLED'],
207 if (is_array($PRECHECK[
'PHP_SETTINGS']))
209 foreach ($PRECHECK[
'PHP_SETTINGS'] as $setting => $value)
211 $actual_setting = ($temp = ini_get($setting)) ? $temp : 0;
212 $status = ($actual_setting == $value);
215 'check' =>
' ' . ($setting),
216 'required' => $value,
217 'actual' => $actual_setting,
230 case 'CUSTOM_CHECKS':
231 if (is_array($PRECHECK[
'CUSTOM_CHECKS']))
233 foreach ($PRECHECK[
'CUSTOM_CHECKS'] as $key => $values)
235 $status = (
true === array_key_exists(
'STATUS', $values)) ? $values[
'STATUS'] :
false;
238 'required' => $values[
'REQUIRED'],
239 'actual' => $values[
'ACTUAL'],
259 if ($failed_checks == 0)
267 <h2>".$HEADING[
'ADDON_PRECHECK_FAILED'].
"</h2>
268 <p>".$MESSAGE[
'ADDON_PRECHECK_FAILED'].
"</p>
270 <table width='700px' cellpadding='4' border='0' style='margin: 0.5em; border-collapse: collapse; border: 1px solid silver;'>
272 <th>".$TEXT[
'REQUIREMENT'].
":</th>
273 <th>".$TEXT[
'REQUIRED'].
":</th>
274 <th>".$TEXT[
'CURRENT'].
":</th>
278 foreach ($msg as $check)
281 $style = $check[
'status'] ?
'color: #46882B;' :
'color: #C00;';
282 foreach ($check as $key => $value)
284 if ($key ==
'status')
288 echo
'<td style="' . $style .
'">' . $value .
'</td>';
298 if (file_exists($temp_addon_file))
300 unlink($temp_addon_file);
304 $admin->print_error(
'');