Last active
January 21, 2016 15:44
-
-
Save joesexton00/fcb31532296f298599a9 to your computer and use it in GitHub Desktop.
CLI Debugging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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