Skip to content

Instantly share code, notes, and snippets.

@robbplo
Last active August 9, 2020 15:58
Show Gist options
  • Save robbplo/cbac102b77adc3232aadc74ba239f332 to your computer and use it in GitHub Desktop.
Save robbplo/cbac102b77adc3232aadc74ba239f332 to your computer and use it in GitHub Desktop.
Fish shell function for toggling Xdebug
function xdebug
set iniFileLocation "/usr/local/etc/php/7.4/conf.d/ext-debug.ini";
set currentLine (cat $iniFileLocation | grep xdebug.so)
if string match -r \#zend_extension $currentLine
sed -i -e 's/^#zend_extension/zend_extension/g' $iniFileLocation
echo "xdebug is now active";
else
sed -i -e 's/^zend_extension/#zend_extension/g' $iniFileLocation
echo "xdebug is now inactive";
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment