snappymail/rainloop/v/1.3.6.461/check.php

40 lines
1 KiB
PHP
Raw Normal View History

2013-09-25 03:04:44 +08:00
<?php
$aRequirements = array(
'cURL' => function_exists('curl_init'),
'iconv' => function_exists('iconv'),
'json' => function_exists('json_encode'),
'DateTime' => class_exists('DateTime') && class_exists('DateTimeZone'),
'libxml' => function_exists('libxml_use_internal_errors'),
'dom' => class_exists('DOMDocument'),
'Zlib' => function_exists('gzopen'),
'PCRE' => function_exists('preg_replace'),
'SPL' => function_exists('spl_autoload_register')
);
2013-10-17 02:52:37 +08:00
if (version_compare(PHP_VERSION, '5.3.0', '<'))
2013-09-25 03:04:44 +08:00
{
echo '<p style="color: red">';
echo 'Your PHP version ('.PHP_VERSION.') is lower than the minimal required 5.3.0! (Error Code: 301)';
echo '</p>';
exit(301);
}
2013-10-17 02:52:37 +08:00
if (in_array(false, $aRequirements))
2013-09-25 03:04:44 +08:00
{
echo '<p>';
2013-10-17 02:52:37 +08:00
echo 'The following PHP extensions are not available in your PHP configuration! (Error Code: 302)';
2013-09-25 03:04:44 +08:00
echo '</p><ul>';
foreach ($aRequirements as $sKey => $bValue)
{
2013-10-17 02:52:37 +08:00
if (!$bValue)
{
echo '<li>'.$sKey.'</li>';
}
2013-09-25 03:04:44 +08:00
}
2013-10-17 02:52:37 +08:00
2013-09-25 03:04:44 +08:00
echo '</ul>';
exit(302);
2013-10-17 02:52:37 +08:00
}