-
Notifications
You must be signed in to change notification settings - Fork 702
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
Install older PHP versions via alternate tap #1411
Conversation
Userland test results: #1407 (comment) |
cli/Valet/Brew.php
Outdated
@@ -135,10 +145,14 @@ public function installOrFail(string $formula, array $options = [], array $taps | |||
} | |||
|
|||
output('<info>['.$formula.'] is not installed, installing it now via Brew...</info> 🍻'); | |||
if ($formula !== 'php' && starts_with($formula, 'php') && preg_replace('/[^\d]/', '', $formula) < '73') { | |||
if ($formula !== 'php' && starts_with($formula, 'php') && preg_replace('/[^\d]/', '', $formula) < '81') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we possibly move 81
here into a const so we can remember to check that regularly too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's just displaying an informational message, ima merge it with the newly-added array constant, since both are actually quite tightly linked. And it's harmless if it shows the message but was wrong, since instead of 10 minutes it'll be 10 seconds, and nobody will be offput by that 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a test as well
d1d2e1b
to
92fe7a7
Compare
Fixes laravel#1407 Homebrew's support policy now aggressively disables older versions earlier than it did previously. That is why we tap the `shivammathur/php` repository. But since Homebrew also now "keeps" those old formulae but marks them as disabled, when Valet runs `brew install [email protected]` it fails because Homebrew just aborts due to its flags in the outdated formula. (They mark it as "disabled" and/or "keg_only :versioned_formula", but don't actually delete the formula from their repository.) To override that we must use `brew install shivammathur/php/[email protected]` internally. Therefore, we need to maintain a list of which PHP Versions we wish to specifically prefix with the `shivammathur/php` tap in order to bypass Homebrew's flags. **ANNUAL MAINTENANCE** 1. This PR adds the array of `LIMITED_PHP_VERSIONS` which we will have to update annually when new PHP versions are retired as others are released. 2. We should also annually update the `LATEST_PHP_VERSION` string.
92fe7a7
to
615d61d
Compare
Fantastic! Thank you! |
Fixes #1407
Homebrew's support policy now aggressively disables older versions earlier than it did previously. That is why we tap the
shivammathur/php
repository.But since Homebrew also now "keeps" those old formulae but marks them as disabled, when Valet runs
brew install [email protected]
it fails because Homebrew just aborts due to its flags in the outdated formula. (They mark it as "disabled" and/or "keg_only :versioned_formula".) To override that we must usebrew install shivammathur/php/[email protected]
internally.Therefore, we need to maintain a list of which PHP Versions we wish to specifically prefix with the
shivammathur/php
tap in order to bypass Homebrew's flags.ANNUAL MAINTENANCE
LIMITED_PHP_VERSIONS
which we will have to update annually when new PHP versions are retired as others are released.LATEST_PHP_VERSION
string.