Last active
August 9, 2020 17:20
-
-
Save bmadigan/b56fc503194fec08f5fd77612ea6dbab to your computer and use it in GitHub Desktop.
ZSH Functions
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
# Switch PHP versions | |
phpv() { | |
valet stop | |
brew unlink [email protected] [email protected] [email protected] | |
brew link --force --overwrite $1 | |
brew services start $1 | |
composer global update | |
valet install | |
} | |
alias php71="phpv [email protected]" | |
alias php72="phpv [email protected]" | |
alias php74="phpv [email protected]" | |
xdebug() { | |
iniFileLocation="/usr/local/etc/php/7.2/conf.d/ext-xdebug.ini"; | |
currentLine=`cat $iniFileLocation | grep xdebug.so` | |
if [[ $currentLine =~ ^#zend_extension ]]; | |
then | |
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"; | |
fi | |
} | |
function db { | |
if [ "$1" = "refresh" ]; then | |
mysql -uroot -e "drop database $2; create database $2" | |
elif [ "$1" = "create" ]; then | |
mysql -uroot -e "create database $2" | |
elif [ "$1" = "drop" ]; then | |
mysql -uroot -e "drop database $2" | |
fi | |
} | |
function homestead() { | |
( cd ~/Homestead && vagrant $* ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment