Skip to content

Instantly share code, notes, and snippets.

@mahype
Created February 24, 2021 09:49
Show Gist options
  • Save mahype/655828a134549ef41bc5a863bbac17e5 to your computer and use it in GitHub Desktop.
Save mahype/655828a134549ef41bc5a863bbac17e5 to your computer and use it in GitHub Desktop.
Xdebug switch
#!/bin/bash
PHP_INI_LOCATION=$(php -r 'echo php_ini_loaded_file();')
if [ "$1" = "on" ];
then
`sed -i '' 's/^;zend_extension/zend_extension/g' $PHP_INI_LOCATION`
echo "Xdebug on in ${PHP_INI_LOCATION}"
valet restart
elif [ "$1" = "off" ];
then
`sed -i '' 's/^zend_extension/;zend_extension/g' $PHP_INI_LOCATION`
echo "Xdebug off in ${PHP_INI_LOCATION}"
valet restart
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment