mirror of
https://github.com/danog/docker-php-extension-installer.git
synced 2024-12-11 17:09:51 +01:00
25a58a500f
uopz disables exit() by default, so we can't assume that exit() will actually quit a PHP script
25 lines
623 B
PHP
25 lines
623 B
PHP
<?php
|
|
|
|
$extension = isset($argv[1]) ? trim($argv[1]) : '';
|
|
$rc = 1;
|
|
|
|
if ($extension === '') {
|
|
fprintf(STDERR, "Missing module handle.\n");
|
|
} else {
|
|
$nameMap = array(
|
|
'opcache' => 'Zend OPcache',
|
|
);
|
|
$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));
|
|
$rc = 0;
|
|
}
|
|
}
|
|
|
|
exit($rc);
|