Created
October 2, 2015 04:51
-
-
Save chernjie/adaf9dff2cd600a6ba4a to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
function _usage() | |
{ | |
echo "$0 [php53|php54|php55|php56]" | |
} | |
function phpversion() | |
{ | |
local _VERSION=$1 | |
for i in php53 php54 php55 php56 | |
do | |
test "$_VERSION" = "$i" || brew unlink "$i" | |
done | |
brew link $_VERSION | |
case $_VERSION in | |
php54) brew link phpunit;; | |
php55) brew link phpunit;; | |
php56) brew link phpunit;; | |
esac | |
echo "Restarting apache..." | |
local libphp5=$(ls -t /usr/local/Cellar/$_VERSION/5*/libexec/apache2/libphp5.so | head -1) | |
sudo ln -sf $libphp5 /usr/libexec/apache2/libphp5.so | |
sudo apachectl -k restart | |
} | |
case $1 in | |
php53|3|53|5.3) phpversion php53;; | |
php54|4|54|5.4) phpversion php54;; | |
php55|5|55|5.5) phpversion php55;; | |
php56|6|56|5.6) phpversion php56;; | |
*) _usage;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment