From 6b34bdde28322c97f3770b0c2a9a233e09d51ca9 Mon Sep 17 00:00:00 2001 From: Andrew Miller Date: Sun, 11 Dec 2022 08:58:23 +0900 Subject: [PATCH 1/5] Update tests for missing PHP versions --- .github/workflows/ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f637d35..eccf364 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,16 +21,26 @@ jobs: - '7.3' - '7.4' - '8.0' + - '8.1' + - '8.2' + - '8.3' 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) From bcc1613b00c1c995371bb75da3c0f116579ee352 Mon Sep 17 00:00:00 2001 From: Andrew Miller Date: Sun, 11 Dec 2022 08:58:31 +0900 Subject: [PATCH 2/5] Update README --- README.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 6904fd6..34c5d9c 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,21 @@ -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, and 8.3 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/php@5.6/lib/httpd/modules/libphp5.so #LoadModule php7_module /usr/local/opt/php@7.0/lib/httpd/modules/libphp7.so @@ -24,28 +24,30 @@ Brew PHP Switcher will automatically add the [Homebrew]'s PHP module location in #LoadModule php7_module /usr/local/opt/php@7.3/lib/httpd/modules/libphp7.so #LoadModule php7_module /usr/local/opt/php@7.4/lib/httpd/modules/libphp7.so #LoadModule php7_module /usr/local/opt/php@8.0/lib/httpd/modules/libphp8.so +#LoadModule php7_module /usr/local/opt/php@8.1/lib/httpd/modules/libphp8.so +#LoadModule php7_module /usr/local/opt/php@8.2/lib/httpd/modules/libphp8.so +#LoadModule php7_module /usr/local/opt/php@8.3/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** or **8.3** 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**, or **8.3** 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 @@ -72,8 +74,7 @@ brew-php-switcher 5.6 -c=valet,apache brew-php-switcher 5.6 -c=apache ``` -License ----- +## License MIT From d51433dfb28322a36c2f122b2ed3f1db39b4d1f0 Mon Sep 17 00:00:00 2001 From: Andrew Miller Date: Sun, 11 Dec 2022 08:58:23 +0900 Subject: [PATCH 3/5] Update tests for missing PHP versions --- .github/workflows/ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f637d35..eccf364 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,16 +21,26 @@ jobs: - '7.3' - '7.4' - '8.0' + - '8.1' + - '8.2' + - '8.3' 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) From 553ff947f39896f65440196a82a27900faf2661b Mon Sep 17 00:00:00 2001 From: Andrew Miller Date: Sun, 11 Dec 2022 08:58:31 +0900 Subject: [PATCH 4/5] Update README --- README.md | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 93e1fa0..c666660 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,21 @@ -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/php@5.6/lib/httpd/modules/libphp5.so #LoadModule php7_module /usr/local/opt/php@7.0/lib/httpd/modules/libphp7.so @@ -23,29 +23,32 @@ Brew PHP Switcher will automatically add the [Homebrew]'s PHP module location in #LoadModule php7_module /usr/local/opt/php@7.2/lib/httpd/modules/libphp7.so #LoadModule php7_module /usr/local/opt/php@7.3/lib/httpd/modules/libphp7.so #LoadModule php7_module /usr/local/opt/php@7.4/lib/httpd/modules/libphp7.so -#LoadModule php7_module /usr/local/opt/php@8.0/lib/httpd/modules/libphp8.so +#LoadModule php_module /usr/local/opt/php@8.0/lib/httpd/modules/libphp8.so +#LoadModule php_module /usr/local/opt/php@8.1/lib/httpd/modules/libphp8.so +#LoadModule php_module /usr/local/opt/php@8.2/lib/httpd/modules/libphp8.so +#LoadModule php_module /usr/local/opt/php@8.3/lib/httpd/modules/libphp8.so +#LoadModule php_module /usr/local/opt/php@8.4/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 @@ -72,8 +75,7 @@ brew-php-switcher 5.6 -c=valet,apache brew-php-switcher 5.6 -c=apache ``` -License ----- +## License MIT From 70f16c95368208eed3cdde6c297fc2b656f7e792 Mon Sep 17 00:00:00 2001 From: Andrew Miller Date: Sat, 30 Nov 2024 08:56:24 +0900 Subject: [PATCH 5/5] Add 8.4 to test PHP versions --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eccf364..5dcb39d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,7 @@ jobs: - '8.1' - '8.2' - '8.3' + - '8.4' steps: - name: "Checkout code"