Merge pull request #3 from davbaumgartner/master

Optimizing extension checking
This commit is contained in:
RainLoop Team 2013-10-16 11:18:48 -07:00
commit a930b7ffbc

View file

@ -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);
} }