From 12ba7965a484da1bf65adf645f162d2f6b14d488 Mon Sep 17 00:00:00 2001 From: Jacob Kiers Date: Fri, 8 Dec 2017 18:30:50 +0100 Subject: [PATCH] Add a better XDebug command Signed-off-by: Jacob Kiers --- bin/xdebug | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/xdebug b/bin/xdebug index 0957d14..9f38775 100755 --- a/bin/xdebug +++ b/bin/xdebug @@ -1,6 +1,15 @@ #!/usr/bin/env bash -COMMAND=`which $1`; +COMMAND=$1; shift 1 -PHP_IDE_CONFIG="serverName=sandbox" XDEBUG_CONFIG="idekey=PHPSTORM remote_host=127.0.0.1 remote_port=19000" php -d xdebug.remote_enable=1 $COMMAND "$@" +if [ ! -f $COMMAND ]; then + COMMAND=`which ${COMMAND}` +fi + +if [ ! -f "${COMMAND}" ]; then + echo "Usage: ${0} " + exit 1; +fi + +PHP_IDE_CONFIG="serverName=local" XDEBUG_CONFIG="remote_enable=1 remote_mode=req remote_port=9000 remote_host=127.0.0.1 remote_connect_back=0" php -d zend_extension=xdebug.so $COMMAND "$@"