Created
December 2, 2019 09:53
-
-
Save Great-Antique/950b998ccdfbb5b52398c658638aa5ac to your computer and use it in GitHub Desktop.
PHP without Xdebug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
temporaryPath="$(mktemp -t php.XXXXXXXXXX).ini" | |
# Using awk to ensure that files ending without newlines do not lead to configuration error | |
php -i \ | |
| grep "\.ini" \ | |
| grep -v COMPOSER_ORIGINAL_INIS \ | |
| grep -v XDEBUG_HANDLER_SETTINGS \ | |
| grep -o -e '\(/[a-z0-9._-]\+\)\+\.ini' \ | |
| grep -v xdebug \ | |
| xargs awk 'FNR==1{print ""}1' > "$temporaryPath" | |
echo "Temporary php.ini path: $temporaryPath" | |
/usr/bin/env php -n -c "$temporaryPath" "$@" | |
tempExitCode="$?" | |
rm -f "$temporaryPath" | |
exit $tempExitCode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment