mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-27 09:08:26 +08:00
Optimizing extension checking
This commit is contained in:
parent
61b5ce8c52
commit
91bd2680ba
1 changed files with 7 additions and 13 deletions
|
@ -12,15 +12,6 @@
|
|||
'SPL' => function_exists('spl_autoload_register')
|
||||
);
|
||||
|
||||
$bRequirements = true;
|
||||
foreach ($aRequirements as $sKey => $bValue)
|
||||
{
|
||||
if (!$bValue)
|
||||
{
|
||||
$bRequirements = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (0 > version_compare(PHP_VERSION, '5.3.0'))
|
||||
{
|
||||
|
@ -30,17 +21,20 @@
|
|||
exit(301);
|
||||
}
|
||||
|
||||
if (!$bRequirements)
|
||||
if (in_array(false,$aRequirements))
|
||||
{
|
||||
echo '<p>';
|
||||
echo 'Required PHP extension are not available in your PHP configuration! (Error Code: 302)';
|
||||
echo 'The following PHP extensions are not available in your PHP configuration! (Error Code: 302)';
|
||||
echo '</p><ul>';
|
||||
|
||||
foreach ($aRequirements as $sKey => $bValue)
|
||||
{
|
||||
echo '<li style="color: '.($bValue ? 'green' : 'red').'">'.$sKey.'</li>';
|
||||
if (!$bValue)
|
||||
{
|
||||
echo '<li>'.$sKey.'</li>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '</ul>';
|
||||
exit(302);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue