Last active
December 12, 2017 00:07
-
-
Save FinBoWa/9e54697233284bdf0302a67ccc5f4f81 to your computer and use it in GitHub Desktop.
Xdebug on
This file contains 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
#/bin/sh | |
CURRENT_USER=`whoami` | |
if [ "$CURRENT_USER" == "vagrant" ]; then | |
cd /vagrant; ./xdebug.sh off | |
else | |
vagrant ssh -c "cd /vagrant; sudo ./xdebug.sh off" | |
fi |
This file contains 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
#/bin/sh | |
CURRENT_USER=`whoami` | |
if [ "$CURRENT_USER" == "vagrant" ]; then | |
cd /vagrant; ./xdebug.sh on | |
else | |
vagrant ssh -c "cd /vagrant; sudo ./xdebug.sh on" | |
fi |
This file contains 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
#!/bin/bash | |
# | |
# Simple toggle script for Xdebug | |
# | |
# Author : Kevin Hill | |
# Date : 2/24/2016 | |
# | |
# | |
################################## | |
# Variables | |
################################## | |
# | |
PHP_DIR="/etc/php.d/" | |
INI="xdebug.ini" | |
XDEBUG='zend_extension="\/usr\/lib64\/php\/modules\/xdebug.so"' | |
################################## | |
# Script | |
################################## | |
# | |
cd $PHP_DIR | |
case "$1" in | |
on) | |
if grep -q "^;$XDEBUG" $INI; then | |
echo "Enabling Xdebug" | |
cat $INI | sed -i.bak "s/^;$XDEBUG/$XDEBUG/g" $INI | |
sudo service php-fpm restart | |
else | |
echo "Already Enabled" | |
fi | |
;; | |
off) | |
if grep -q "^$XDEBUG" $INI; then | |
echo "Disabling Xdebug" | |
cat $INI | sed -i.bak "s/^$XDEBUG/;$XDEBUG/g" $INI | |
sudo service php-fpm restart | |
else | |
echo "Already Disabled" | |
fi | |
;; | |
*) | |
echo "Usage: xdebug [on|off]" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment