From 79074be9266447caa56b015ca5a1186c780f6de4 Mon Sep 17 00:00:00 2001 From: Jacob Kiers Date: Tue, 27 Jan 2015 12:25:03 +0100 Subject: [PATCH] Improve bin/xdebug to use command from path. It uses the `which` command to find the command that you actually want to run, and runs that. This makes it possible to run any php binary (like phpunit or phing) with xdebug. Signed-off-by: Jacob Kiers --- bin/xdebug | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/xdebug b/bin/xdebug index e5bf67f..0957d14 100755 --- a/bin/xdebug +++ b/bin/xdebug @@ -1,5 +1,6 @@ -#!/bin/bash +#!/usr/bin/env bash -#XDEBUG_REMOTE_HOST=`echo $SSH_CLIENT | cut -d " " -f 1` +COMMAND=`which $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 "$@" +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 "$@"