Abort if installing PHP extensions introduces new PHP startup errors (#541)
Test: bcmath+xdebugpull/542/head 1.4.28
parent
fa7e016989
commit
7ba4e7a920
|
@ -1435,9 +1435,10 @@ checkModuleWorking() {
|
||||||
checkModuleWorking_inientry=extension
|
checkModuleWorking_inientry=extension
|
||||||
fi
|
fi
|
||||||
printf 'Check if the %s %s can be loaded... ' "$checkModuleWorking_inientry" "$1"
|
printf 'Check if the %s %s can be loaded... ' "$checkModuleWorking_inientry" "$1"
|
||||||
checkModuleWorking_err="$(php -d "$checkModuleWorking_inientry=$checkModuleWorking_file" -r 'return;' 2>&1 || true)"
|
checkModuleWorking_errBefore="$(php -r 'return;' 2>&1 || true)"
|
||||||
if test -n "$checkModuleWorking_err"; then
|
checkModuleWorking_errAfter="$(php -d "$checkModuleWorking_inientry=$checkModuleWorking_file" -r 'return;' 2>&1 || true)"
|
||||||
printf 'Error loading the "%s" extension from "%s":\n%s\n' "$1" "$checkModuleWorking_file" "$checkModuleWorking_err" >&2
|
if test "$checkModuleWorking_errAfter" != "$checkModuleWorking_errBefore"; then
|
||||||
|
printf 'Error loading the "%s" extension from "%s":\n%s\n' "$1" "$checkModuleWorking_file" "$checkModuleWorking_errAfter" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
printf 'ok.\n'
|
printf 'ok.\n'
|
||||||
|
@ -2127,6 +2128,7 @@ EOF
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
installBundledModule_errBefore="$(php -r 'return;' 2>&1 || true)"
|
||||||
docker-php-ext-install -j$(getProcessorCount) "$1"
|
docker-php-ext-install -j$(getProcessorCount) "$1"
|
||||||
case "$1" in
|
case "$1" in
|
||||||
imap)
|
imap)
|
||||||
|
@ -2137,9 +2139,9 @@ EOF
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
installBundledModule_err="$(php -r 'return;' 2>&1 || true)"
|
installBundledModule_errAfter="$(php -r 'return;' 2>&1 || true)"
|
||||||
if test -n "$installBundledModule_err"; then
|
if test "$installBundledModule_errAfter" != "$installBundledModule_errBefore"; then
|
||||||
printf 'PHP has problems after installing the "%s" extension:\n%s\n' "$1" "$installBundledModule_err" >&2
|
printf 'PHP has problems after installing the "%s" extension:\n%s\n' "$1" "$installBundledModule_errAfter" >&2
|
||||||
rm "$PHP_INI_DIR/conf.d/docker-php-ext-$1.ini" || true
|
rm "$PHP_INI_DIR/conf.d/docker-php-ext-$1.ini" || true
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue