Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.5 #85

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,27 @@ jobs:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
- '8.4'

steps:
- name: "Checkout code"
uses: actions/checkout@v2.3.3
uses: actions/checkout@v4

- run: |
set -xe

# Related issue: https://github.com/actions/setup-python/issues/577
# Unlink and re-link to prevent errors when GitHub macOS runner images install Node outside of brew.
brew list -1 | grep node | while read formula; do brew unlink $formula; brew link --overwrite $formula; done
# Unlink and re-link to prevent errors when GitHub macOS runner images install Python outside of brew.
brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done

brew --version
brew tap shivammathur/php
brew update
brew install shivammathur/php/php@${{ matrix.php-version }}
./phpswitch.sh ${{ matrix.php-version }} -s
switched=$(php -v | grep -e '^PHP' | cut -d' ' -f2 | cut -d. -f1,2)
Expand Down
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,54 @@
Brew PHP Switcher [![CI](https://github.com/philcook/brew-php-switcher/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/philcook/brew-php-switcher/actions/workflows/ci.yml)
=========
# Brew PHP Switcher [![CI](https://github.com/philcook/brew-php-switcher/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/philcook/brew-php-switcher/actions/workflows/ci.yml)

Brew PHP switcher is a simple script to switch your Apache and CLI configs quickly between major versions of PHP.

If you support multiple products/projects that are built using either brand new or old legacy PHP functionality and you find it a pain to change config files continually this will make the whole process just one command.

Caveats
-------
## Caveats

For users of OSX only who have installed PHP via [Homebrew] and for PHP version 5.6, 7.0, 7.1, 7.2, 7.3, 7.4 and 8.0 only.
For users of OSX only who have installed PHP via [Homebrew] and for PHP version 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, and 8.4 only.

Your Apache config must have native osx PHP module commented out.

```sh
#LoadModule php5_module libexec/apache2/libphp5.so
```

Brew PHP Switcher will automatically add the [Homebrew]'s PHP module location in the Apache config in the following format.

```sh
#LoadModule php5_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp5.so
#LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
#LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
#LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
#LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
#LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
#LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp8.so
#LoadModule php_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp8.so
#LoadModule php_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp8.so
#LoadModule php_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp8.so
#LoadModule php_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp8.so
#LoadModule php_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp8.so
```

Version
----
## Version

2.3
2.5

## Installation

Installation
--------------
```sh
brew install brew-php-switcher
```

Where **5.6** exists, please replace with syntax of **5.6**, **7.0**, **7.1**, **7.2**, **7.3**, **7.4**, **8.0**, **8.1**, **8.2**, **8.3** or **8.4** depending on which version is required.
Where **5.6** exists, please replace with syntax of **5.6**, **7.0**, **7.1**, **7.2**, **7.3**, **7.4**, **8.0**, **8.1**, **8.2**, **8.3**, or **8.4** depending on which version is required.

```sh
brew-php-switcher 5.6
```

> by default will switch apache config

Options
--------------
## Options

- `-s|-s=*` Skips apache & valet config switch for i.e

Expand All @@ -72,8 +75,7 @@ brew-php-switcher 5.6 -c=valet,apache
brew-php-switcher 5.6 -c=apache
```

License
----
## License

MIT

Expand Down
Loading