mirror of
https://github.com/danog/docker-php-extension-installer.git
synced 2024-12-04 10:28:05 +01:00
22 lines
472 B
PHP
22 lines
472 B
PHP
|
<?php
|
||
|
|
||
|
$extension = isset($argv[1]) ? trim($argv[1]) : '';
|
||
|
|
||
|
if ($extension === '') {
|
||
|
fprintf(STDERR, "Missing module handle.\n");
|
||
|
exit(1);
|
||
|
}
|
||
|
$nameMap = array(
|
||
|
'opcache' => 'Zend OPcache',
|
||
|
);
|
||
|
$extensionLowerCase = strtolower($extension);
|
||
|
if (isset($nameMap[$extensionLowerCase])) {
|
||
|
$extension = $nameMap[$extensionLowerCase];
|
||
|
}
|
||
|
|
||
|
if (extension_loaded($extension)) {
|
||
|
exit(0);
|
||
|
}
|
||
|
fprintf(STDERR, sprintf("Extension not loaded: %s\n", $extension));
|
||
|
exit(1);
|