mirror of
https://github.com/mlocati/docker-php-extension-installer
synced 2025-05-08 16:17:20 +00:00

uopz disables exit() by default, so we can't assume that exit() will actually quit a PHP script
24 lines
623 B
PHP
24 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);
|