Skip to content

Instantly share code, notes, and snippets.

@joesexton00
Last active January 21, 2016 15:44
Show Gist options
  • Save joesexton00/fcb31532296f298599a9 to your computer and use it in GitHub Desktop.
Save joesexton00/fcb31532296f298599a9 to your computer and use it in GitHub Desktop.
CLI Debugging
# PHP CLI DEBUGGING
# `php-debug mysite.dev app/console cache:clear`
alias php-debug=phpdebug
function phpdebug {
CMD=`export PHP_IDE_CONFIG='serverName="echo $1"'`
eval $CMD
export XDEBUG_CONFIG="idekey=PHPSTORM"
shift
"$@"
unset XDEBUG_CONFIG
unset PHP_IDE_CONFIG
};
# PHP CLI DEBUGGING USING A VAGRANT VM
# THIS MUST BE ADDED TO THE `~/.bash_profile` OF THE VM
# `php-debug-vagrant app/console cache:clear`
alias php-debug-vagrant=phpdebugvagrant
function phpdebugvagrant {
export PHP_IDE_CONFIG='serverName=api.petfinder.dev'
CONNECTBACK=`echo $SSH_CLIENT | awk '{print $1}'`
export XDEBUG_CONFIG="idekey=PHPSTORM remote_host=$CONNECTBACK remote_port=9000"
"$@"
unset XDEBUG_CONFIG
unset PHP_IDE_CONFIG
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment