Generate XDebug-enabled versions of each brewed PHP
This commit is contained in:
parent
ce52cd1c69
commit
628b035213
1 changed files with 18 additions and 1 deletions
|
@ -1,7 +1,24 @@
|
|||
#!/usr/bin/env zsh
|
||||
make-xdebug-wrapper() {
|
||||
cat <<EOF >$1-xdebug || return $?
|
||||
#!/usr/bin/env zsh
|
||||
defaults=(
|
||||
zend_extension=xdebug.so
|
||||
xdebug.mode=debug
|
||||
xdebug.client_host=127.0.0.1
|
||||
xdebug.start_with_request=true
|
||||
)
|
||||
exec $1 -d\${^defaults} "\$@"
|
||||
EOF
|
||||
chmod u+x $1-xdebug
|
||||
}
|
||||
|
||||
cd ~/bin || exit $?
|
||||
for bin in /usr/local/opt/php@*/bin/php; do
|
||||
name=php${${bin##*@}%%/*}
|
||||
echo "Linking ~/bin/$name -> $bin" >&2
|
||||
ln -fs $bin $name
|
||||
ln -fs $bin $name || exit $?
|
||||
|
||||
echo "Generating XDebug wrapper ~/bin/$name-xdebug" >&2
|
||||
make-xdebug-wrapper $name || exit $?
|
||||
done
|
||||
|
|
Loading…
Add table
Reference in a new issue