Skip to content

Commit

Permalink
Merge pull request #24 from JamesRezo/php71
Browse files Browse the repository at this point in the history
PHP7.1 Support
  • Loading branch information
philcook authored Aug 20, 2016
2 parents d964ff0 + 0dc7b3e commit e1370ee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis/test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

error=0
for version in 53 54 55 56 70
for version in 53 54 55 56 70 71
do
. `echo $(dirname $0)"/../phpswitch.sh"` $version -s > /dev/null
switched=$(php -v | grep -e '^PHP' | cut -d' ' -f2 | cut -d. -f1,2 | sed 's/\.//')
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ If you support multiple products/projects that are built using either brand new
Caveats
-------

For users of OSX only who have installed PHP via [Homebrew] and for PHP version 5.3, 5.4, 5.5, 5.6 and 7.0 only.
For users of OSX only who have installed PHP via [Homebrew] and for PHP version 5.3, 5.4, 5.5, 5.6, 7.0 and 7.1 only.

Your Apache config must have native osx PHP module commented out.
```sh
Expand All @@ -22,6 +22,7 @@ LoadModule php5_module /usr/local/opt/php54/libexec/apache2/libphp5.so
LoadModule php5_module /usr/local/opt/php55/libexec/apache2/libphp5.so
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
LoadModule php7_module /usr/local/opt/php70/libexec/apache2/libphp7.so
LoadModule php7_module /usr/local/opt/php71/libexec/apache2/libphp7.so
```

Version
Expand All @@ -35,7 +36,7 @@ Installation
brew install brew-php-switcher
```

Where **56** exists, please replace with syntax of **53**, **54**, **55**, **56** or **70** depending on which version is required.
Where **56** exists, please replace with syntax of **53**, **54**, **55**, **56**, **70** or **71** depending on which version is required.
```sh
brew-php-switcher 56
```
Expand Down
8 changes: 4 additions & 4 deletions phpswitch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# Twitter: @p_cook
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')

brew_array=("53","54","55","56","70")
php_array=("php53" "php54" "php55" "php56" "php70")
brew_array=("53","54","55","56","70","71")
php_array=("php53" "php54" "php55" "php56" "php70" "php71")
php_installed_array=()
php_version="php$1"
php_opt_path="$brew_prefix\/opt\/"
Expand All @@ -18,7 +18,7 @@ native_osx_php_apache_module="LoadModule php5_module libexec\/apache2\/libphp5.s

php_module="$php5_module"
apache_php_lib_path="$apache_php5_lib_path"
if [ $php_version = "php70" ]; then
if [ $(echo "$php_version" | sed 's/^php//') -ge 70 ]; then
php_module="$php7_module"
apache_php_lib_path="$apache_php7_lib_path"
fi
Expand Down Expand Up @@ -87,7 +87,7 @@ then
do
loop_php_module="$php5_module"
loop_apache_php_lib_path="$apache_php5_lib_path"
if [ $j = "php70" ]; then
if [ $(echo "$j" | sed 's/^php//') -ge 70 ]; then
loop_php_module="$php7_module"
loop_apache_php_lib_path="$apache_php7_lib_path"
fi
Expand Down

0 comments on commit e1370ee

Please sign in to comment.