Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit a930b7f

Browse files
committed
Merge pull request #3 from davbaumgartner/master
Optimizing extension checking
2 parents b275ce6 + 91bd268 commit a930b7f

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

rainloop/v/1.3.0.442/check.php

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@
1212
'SPL' => function_exists('spl_autoload_register')
1313
);
1414

15-
$bRequirements = true;
16-
foreach ($aRequirements as $sKey => $bValue)
17-
{
18-
if (!$bValue)
19-
{
20-
$bRequirements = false;
21-
break;
22-
}
23-
}
2415

2516
if (0 > version_compare(PHP_VERSION, '5.3.0'))
2617
{
@@ -30,17 +21,20 @@
3021
exit(301);
3122
}
3223

33-
if (!$bRequirements)
24+
if (in_array(false,$aRequirements))
3425
{
3526
echo '<p>';
36-
echo 'Required PHP extension are not available in your PHP configuration! (Error Code: 302)';
27+
echo 'The following PHP extensions are not available in your PHP configuration! (Error Code: 302)';
3728
echo '</p><ul>';
3829

3930
foreach ($aRequirements as $sKey => $bValue)
4031
{
41-
echo '<li style="color: '.($bValue ? 'green' : 'red').'">'.$sKey.'</li>';
32+
if (!$bValue)
33+
{
34+
echo '<li>'.$sKey.'</li>';
35+
}
4236
}
4337

4438
echo '</ul>';
4539
exit(302);
46-
}
40+
}

0 commit comments

Comments
 (0)