2018-12-11 14:48:50 +00:00
|
|
|
<?php
|
|
|
|
|
2019-12-18 15:45:20 +00:00
|
|
|
$rc = 0;
|
|
|
|
$numTestedExtensions = 0;
|
|
|
|
$nameMap = array(
|
|
|
|
'opcache' => 'Zend OPcache',
|
|
|
|
);
|
|
|
|
for ($index = 1, $count = isset($argv) ? count($argv) : 0; $index < $count; $index++) {
|
|
|
|
$numTestedExtensions++;
|
|
|
|
$rcThis = 1;
|
|
|
|
$extension = $argv[$index];
|
|
|
|
if ($extension === '') {
|
|
|
|
fprintf(STDERR, "Missing extension handle.\n");
|
2019-09-27 15:29:02 +00:00
|
|
|
} else {
|
2019-12-18 15:45:20 +00:00
|
|
|
$extensionLowerCase = strtolower($extension);
|
|
|
|
if (isset($nameMap[$extensionLowerCase])) {
|
|
|
|
$extension = $nameMap[$extensionLowerCase];
|
|
|
|
}
|
|
|
|
if (!extension_loaded($extension)) {
|
|
|
|
fprintf(STDERR, sprintf("Extension not loaded: %s\n", $extension));
|
|
|
|
} else {
|
|
|
|
fprintf(STDOUT, sprintf("Extension correctly loaded: %s\n", $extension));
|
|
|
|
$rcThis = 0;
|
|
|
|
}
|
2019-09-27 15:29:02 +00:00
|
|
|
}
|
2019-12-18 15:45:20 +00:00
|
|
|
if ($rcThis !== 0) {
|
|
|
|
$rc = $rcThis;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($numTestedExtensions === 0) {
|
|
|
|
fprintf(STDERR, "No extension handles specified.\n");
|
|
|
|
$rc = 1;
|
2018-12-11 14:48:50 +00:00
|
|
|
}
|
|
|
|
|
2019-09-27 15:29:02 +00:00
|
|
|
exit($rc);
|