mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-26 16:26:44 +03:00
Merge pull request #3 from davbaumgartner/master
Optimizing extension checking
This commit is contained in:
commit
a930b7ffbc
1 changed files with 7 additions and 13 deletions
|
|
@ -12,15 +12,6 @@
|
||||||
'SPL' => function_exists('spl_autoload_register')
|
'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'))
|
if (0 > version_compare(PHP_VERSION, '5.3.0'))
|
||||||
{
|
{
|
||||||
|
|
@ -30,17 +21,20 @@
|
||||||
exit(301);
|
exit(301);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$bRequirements)
|
if (in_array(false,$aRequirements))
|
||||||
{
|
{
|
||||||
echo '<p>';
|
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>';
|
echo '</p><ul>';
|
||||||
|
|
||||||
foreach ($aRequirements as $sKey => $bValue)
|
foreach ($aRequirements as $sKey => $bValue)
|
||||||
{
|
{
|
||||||
echo '<li style="color: '.($bValue ? 'green' : 'red').'">'.$sKey.'</li>';
|
if (!$bValue)
|
||||||
|
{
|
||||||
|
echo '<li>'.$sKey.'</li>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</ul>';
|
echo '</ul>';
|
||||||
exit(302);
|
exit(302);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue