2021-08-16 14:53:10 +10:00
|
|
|
#!/usr/bin/env zsh
|
2025-02-11 16:12:07 +11:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2021-08-16 14:53:10 +10:00
|
|
|
cd ~/bin || exit $?
|
|
|
|
for bin in /usr/local/opt/php@*/bin/php; do
|
|
|
|
name=php${${bin##*@}%%/*}
|
|
|
|
echo "Linking ~/bin/$name -> $bin" >&2
|
2025-02-11 16:12:07 +11:00
|
|
|
ln -fs $bin $name || exit $?
|
|
|
|
|
|
|
|
echo "Generating XDebug wrapper ~/bin/$name-xdebug" >&2
|
|
|
|
make-xdebug-wrapper $name || exit $?
|
2021-08-16 14:53:10 +10:00
|
|
|
done
|