- Add --site to isolate
- Add --site to unisolate
- Refactor some tests
- Update Site@getSiteUrl to throw an exception instead of returning false
- Fix a few minor typos/grammatical issues
Before the change, when running `valet use` the code intended to stop currently running PHP services. But the `getRunningServices` method only returned non-root running services. As PHP services started by Valet are run using `sudo` (so running as root), they were not returned and subsequently not stopped.
This change is intended to fix the above and stop PHP services that are started by Valet on a PHP version switch.
When switching PHP versions the valet.sock file may not be removed if the linked PHP process doesn't get shut down properly. This can happen when Homebrew switches default `php` version aliases and if one has started multiple homebrew PHP instances under different permission levels or different users.
This patch merely forces the .sock file's removal when switching versions.
In very rare cases a filesystem lock may prevent the file's proper removal, in which case a reboot might be required.
To prevent these issues, keep Homebrew up-to-date by running `brew upgrade` on a regular basis (weekly is good).
- properly detects if the requested version is already installed, and skips re-installing/re-starting/re-configuring
- allows --force to re-configure anyway
- smarter treatment of 'php' when it's aliased to another specific installed version
Old: `/usr/local/var/log/php-fpm.log`
New: `~/.config/valet/Log/php-fpm.log`
(We already put `~/.config/valet/Log/nginx-error.log` there)
This avoids ARM Mac differences in directory paths.
Fixes#756
Previously if `php` was installed as just `php` (the default Homebrew alias), Valet would not detect *which* PHP version was actually installed, and therefore `valet use` might do incorrect or unnecessary installations/links/etc.
NOTE: This does NOT "convert" existing `php` alias to a numbered version. It merely accepts it as-is, but notes its version in an attempt to avoid extra installations.
*NOTE: Specifally tested with PHP 7.4 and 7.3. No promises about old 5.6, etc aliases.*
`valet uninstall` only displays information about how to manually uninstall and clean up after Valet.
This PR adds a `--force` parameter, which will forcefully remove Valet and the Homebrew services it installs, as well as clean up the config files and log files.
But for a few post-uninstall composer dependencies, cleanup is very thorough.
This brings idempotency to both `valet install` and `valet uninstall --force`
(There may still be edge cases where other Homebrew or composer packages might create interference with install/uninstall, but this makes things much easier to self-troubleshoot.)
This allows the valet configuration to stand separately from the default PHP config.
This benefits troubleshooting, makes customization of FPM workers and other settings easer
and allows for easier uninstallation.
Also renames any previously-existing `www.conf` pool config so it doesn't conflict with Valet nor run unnecessary additional processes.