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

Fix switching php versions not listening to error states #455

Merged
merged 4 commits into from
Feb 10, 2020

Conversation

Neodork
Copy link
Collaborator

@Neodork Neodork commented Feb 7, 2020


I have read the contribution guidelines and am targeting the branch 2.x:
Because this is a Bug Fix which is Backwards Compatible.

Changelog entry:
Short description of your work as explained by: Keep A Changelog.

  • Fixed bug where switching PHP version to a flawed installation would result in an unusable valet-plus installation.

@Neodork Neodork self-assigned this Feb 7, 2020
@Neodork Neodork added 2.x Issues / features related the the 2.x branch PATCH This change is patch level labels Feb 7, 2020
Copy link
Collaborator

@SanderAtom SanderAtom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this patch I could only break my installation because of an odd setup where I had a /usr/local/Cellar/[email protected]/7.2.24_2.reinstall folder left which was chosen by default when switching. After removing that I could not break the switching anymore. Removing 7.2 and switching to it displays the error and keeps the current php version linked as expected.

sander$ brew uninstall [email protected]
Uninstalling /usr/local/Cellar/[email protected]/7.2.24_2... (515 files, 75.0MB)
Error: Could not remove [email protected] keg! Do so manually:
  sudo rm -rf /usr/local/Cellar/[email protected]/7.2.24_2
sander$ sudo rm -rf /usr/local/Cellar/[email protected]/7.2.24_2
sander$ valet use 7.2
[[email protected]] Unlinking
Unlinking /usr/local/Cellar/[email protected]/7.3.2... 25 symlinks removed

[libjpeg] Relinking
[[email protected]] Linking
Linking /usr/local/Cellar/[email protected]/7.2.24_2.reinstall... 25 symlinks
[[email protected]] Stopping
[[email protected]] Stopping
[[email protected]] Stopping
[[email protected]] Stopping
[[email protected]] Stopping
[[email protected]] Stopping
[BREW TAP] henkrehorst/php already installed
PHP Warning:  file_get_contents(/usr/local/bin/pecl: line 28: /usr/local/Cellar/[email protected]/7.2.24_2/bin/php: No such file or directory/usr/local/bin/pecl: line 28: exec: /usr/local/Cellar/[email protected]/7.2.24_2/bin/php: cannot execute: No such file or directory): failed to open stream: No such file or directory in /Users/sander/.composer/vendor/weprovide/valet-plus/cli/Valet/Filesystem.php on line 112

@Neodork
Copy link
Collaborator Author

Neodork commented Feb 7, 2020

@SanderAtom Thanks for the review I'll fix the typos and rehit the CI/CD.

So if I understand correctly it works as intended?

@SanderAtom
Copy link
Collaborator

Yes, I don't think it's worth it to check for my specific situation.

Neodork and others added 3 commits February 7, 2020 16:12
@Neodork
Copy link
Collaborator Author

Neodork commented Feb 7, 2020

@SanderAtom Yeah this commit is also not geared towards solving the issues. But more towards keeping valet-plus intact if encountering one.

I feel like the fixing part is for valet fix

@Neodork Neodork merged commit c1e4da0 into weprovide:2.x Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issues / features related the the 2.x branch PATCH This change is patch level
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants