1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 16:10:08 +01:00
Commit Graph

96 Commits

Author SHA1 Message Date
Matt Stauffer
3772761881 Add extra info output to phpfpm install method 2022-04-18 13:38:16 -04:00
NasirNobin
0267da704e remove preg_replace deprecation warning 2022-04-16 18:47:38 +06:00
Matt Stauffer
29b2f45719 Add --site to isolate and unisolate commands
- 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
2022-03-21 01:25:23 -04:00
NasirNobin
9fdc02021a Fix Homebrew PHP default www pools issue 2022-03-16 19:12:44 +06:00
Matt Stauffer
b09a9163fa Inline site check in unisolate command 2022-03-14 15:02:16 -04:00
Matt Stauffer
b1d9b2b669 Clean up 2022-03-14 15:00:05 -04:00
Matt Stauffer
383aa62137 Change magic isolation config string to "ISOLATED_PHP_VERSION"
Co-Authored-By: Jacob Baker-Kretzmar <18192441+bakerkretzmar@users.noreply.github.com>
2022-03-14 14:40:45 -04:00
Matt Stauffer
e4c7a9b3e5 Symlink valet.sock *after* restarting so it's not deleted by restarting PHP-FPM
Co-Authored-By: Jacob Baker-Kretzmar <18192441+bakerkretzmar@users.noreply.github.com>
2022-03-14 14:22:37 -04:00
Matt Stauffer
b8885a4115 Move deleting valet.sock into install()
Co-Authored-By: Jacob Baker-Kretzmar <18192441+bakerkretzmar@users.noreply.github.com>
2022-03-14 14:10:49 -04:00
Matt Stauffer
17cda5dc79 Drop todos 2022-03-14 13:58:52 -04:00
Matt Stauffer
984d7eb699 Add PHP Version to the isolated command 2022-03-14 13:41:48 -04:00
Matt Stauffer
118e0a3692 Update str_contains to strpos 2022-03-14 12:55:20 -04:00
StyleCI Bot
9b8c41e3d3 Apply fixes from StyleCI 2022-03-14 04:16:45 +00:00
Matt Stauffer
95aa03977c Add command to list isolated sites 2022-03-14 00:16:36 -04:00
StyleCI Bot
fd47384768 Apply fixes from StyleCI 2022-03-14 02:18:58 +00:00
Matt Stauffer
4ab6f46870 Merge branch 'mes/symlink-valet-socks' of github.com:laravel/valet into mes/symlink-valet-socks 2022-03-13 22:18:47 -04:00
Matt Stauffer
530e4c30dd Update normalizePhpVersion regex
Handle "php@8.1"
Simplify the entire method into one block

Co-Authored-By: Nathan Morgan <nathan@fuelingtheweb.com>
2022-03-13 22:17:50 -04:00
Matt Stauffer
7226da5bb7 Update valet.sock symlink 2022-03-13 22:17:11 -04:00
StyleCI Bot
89fd8bc30b Apply fixes from StyleCI 2022-03-13 04:29:11 +00:00
Matt Stauffer
51742b3795 Make primary valet.sock a symlink to an existing version 2022-03-12 23:29:01 -05:00
Matt Stauffer
3570c748a0 Clean up PhpFPM readability 2022-03-12 22:37:57 -05:00
Matt Stauffer
592354877d Rename isolateDirectory 2022-03-12 22:28:25 -05:00
StyleCI Bot
0a677e2d53 Apply fixes from StyleCI 2022-03-12 05:23:47 +00:00
Matt Stauffer
5aa253ad6d Move string concat to one line 2022-03-12 00:23:35 -05:00
Matt Stauffer
55c7dcb99d Move string concat to one line 2022-03-12 00:23:00 -05:00
Matt Stauffer
33c797f9ef Drop need to pass sock to isolate command 2022-03-12 00:20:40 -05:00
StyleCI Bot
e797774ade Apply fixes from StyleCI 2022-03-12 05:06:07 +00:00
Matt Stauffer
eefc06b07f Drop PHP 5.6; extract site-specific PHP version isolation to its own commands 2022-03-12 00:05:51 -05:00
Nasir Uddin Nobin
9a5d30bb69 Tests for Parallel PHP Version Support 2022-02-18 15:14:57 +06:00
Nasir Uddin Nobin
cc41e3c19f Update cli/Valet/PhpFpm.php
Co-authored-by: Matt Stauffer <mattstauffer@users.noreply.github.com>
2022-02-18 05:59:22 +06:00
NasirNobin
3c8336791f Apply more suggestions from code review 2022-02-16 11:29:51 +06:00
Nasir Uddin Nobin
49ca4ae467 Apply suggestions from code review
Co-authored-by: Matt Stauffer <mattstauffer@users.noreply.github.com>
2022-02-16 11:21:41 +06:00
Nasir Uddin Nobin
5c1043776e Apply refactor & cleanup from the code review 2022-02-15 16:44:29 +06:00
NasirNobin
794e366ba5 StyleCI Patch 2022-02-15 05:05:21 +06:00
NasirNobin
8de8d9bb26 Stop unused PHP versions 2022-02-15 04:49:03 +06:00
Nasir Uddin Nobin
c247dc9709 Add Valet PHP isolation remover option & apply more suggestions from code review 2022-02-15 02:38:46 +06:00
Nasir Uddin Nobin
acf190c57c Apply suggestions from code review
Co-authored-by: Matt Stauffer <mattstauffer@users.noreply.github.com>
2022-02-15 02:05:48 +06:00
NasirNobin
37b4af4113 Multiple/Parallel PHP Version Support for Valet 2022-02-06 13:56:35 +06:00
Cristian Calara
9e3a89c742 Stop root homebrew services on php version switch
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.
2022-01-08 10:30:13 +02:00
Taylor Otwell
101abeae0e Apply fixes from StyleCI 2021-12-06 10:40:37 +00:00
Chris Brown
dd17bb9e9a Force removal of orphaned valet.sock file
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).
2021-01-21 11:33:47 -05:00
Chris Brown
98e7a02a3c Add shivammathur/php tap for supporting unofficial PHP releases 2020-11-28 23:49:03 -05:00
Chris Brown
a03e2e09ce Improvements to "valet use" command
- 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
2020-11-28 23:38:30 -05:00
Chris Brown
be63541dd8 Normalize PHP version parsing 2020-11-28 23:17:21 -05:00
Chris Brown
ce0999f8cd Point PHP-FPM error_log to user directory
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.
2020-11-23 09:21:55 -05:00
soilSpoon
2c06a5d4f0 Modify the paths of packages to be based on brew prefix
- brew
- dnsmasq
- nginx
- php-fpm
- log
- etc
2020-11-15 14:38:18 +09:00
Chris Brown
116c7a7b8c Detect running php when no version constraint specified with use command
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.*
2020-01-04 13:36:20 -05:00
Chris Brown
6e01bfb5f4 Allow Valet to uninstall itself
`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.)
2019-12-05 22:19:55 -05:00
Chris Brown
139a916013 Move PHP-FPM config to separate valet-specific file
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.
2019-12-05 15:01:11 -05:00
Matt Allan
76a0c3222e Fix incorrect comments 2019-08-07 11:11:51 -04:00