1
0
Fork 0
mirror of https://github.com/mlocati/docker-php-extension-installer synced 2025-05-11 01:22:42 +00:00

Remove not passing extensions, test fewer extensions, fix installed extensions check

This commit is contained in:
Michele Locati 2018-12-11 15:48:50 +01:00
parent 6fbd39d2fa
commit 817156a26f
3 changed files with 40 additions and 19 deletions

View file

@ -0,0 +1,21 @@
<?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);

View file

@ -56,7 +56,7 @@ testExtension () {
testExtension_Image="$(getExtensionImage "${1}" "${2}")"
printf ' - Docker image: %s\n' "${testExtension_Image}"
testExtension_out=`mktemp`
if $(docker run --rm --volume "${TRAVIS_BUILD_DIR}:/app" --workdir /app "${testExtension_Image}" bash -c "./install-php-extensions ${1} && php -r "'"'"exit(extension_loaded('${1}') ? 0 : 1);"'"'"" >"${testExtension_out}" 2>&1); then
if $(docker run --rm --volume "${TRAVIS_BUILD_DIR}:/app" --workdir /app "${testExtension_Image}" bash -c "./install-php-extensions '${1}' && php ./scripts/check-installed-extension.php '${1}'" >"${testExtension_out}" 2>&1); then
rm -rf "${testExtension_out}"
printf ' - Passed\n'
return 0