Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for users running PHP 7.4 as their primary linked PHP as long as they still have PHP 8+ installed on their machine (as an un-linked Brew install).
Calls to
valet
now check if the current linked PHP version is 8+; if it isn't,valet
checks whether there's a Brew-installed version of PHP that's 8+, and if so, uses those commands to run Valet.This shouldn't introduce any lag for users with modern PHP installed, as
php -r "echo phpversion();"
is very fast. Users running PHP prior to 8 will see a close-to-one-second lag in all Valet commands; this way we're providing support for those users, but also encouraging those users to start using PHP 8+ and to usevalet php
orvalet composer
to proxy their calls back to the older, isolated PHP versions.This is a hack of a fix, and may well be removed in the next major version, although at that point we may choose to keep this script but bump up the version we're checking against.
Currently tested and working on PHP 7.4, since WordPress still runs on PHP 7.4.
I'll test PHP 7.3 and 7.2, but if either require any major changes, I don't plan to support them.