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

85 Commits

Author SHA1 Message Date
Dries Vints
d0d42acff7 PHP 8.2 support (#1279)
* PHP 8.2 support

* wip

* Apply fixes from StyleCI

* wip

* wip

* wip

* Update tests.yml

Co-authored-by: StyleCI Bot <bot@styleci.io>
2022-09-08 13:37:17 +02:00
Matt Stauffer
0045896d8e Merge pull request #1216 from NasirNobin/feature/valet-run
PHP version isolation helper for command line
2022-03-31 09:55:22 -04:00
Nasir Uddin Nobin
d198d7739c wip - refactor with valetphprc version (#10) 2022-03-30 03:48:03 +06:00
be57ffaf36 CI fixes 2022-03-29 20:07:19 +02:00
e7cd171582 Remove unnecessary comment 2022-03-29 20:01:45 +02:00
a52355ec49 Restore original directory permissions
As discussed in #1220, cleaning up after stopping Homebrew services that
run as root is probably the best solution for now.

What's changed:

- Stopping any Homebrew service now restores the appropriate permissions
  for the Homebrew directories
- Stopping nginx now also happens via $this->brew
  (to avoid code duplication)

The tests were updated to reflect this change.
2022-03-29 19:59:33 +02:00
NasirNobin
0202f7773a remove static from normalizePhpVersion 2022-03-29 23:17:32 +06:00
NasirNobin
dd8c8fc663 add normalizePhpVersion inside getPhpExecutablePath 2022-03-29 09:10:07 +06:00
NasirNobin
1838945f57 Fix typo on arePhpVersionsEqual 2022-03-29 09:01:22 +06:00
Nasir Uddin Nobin
40cb21ec91 Apply suggestions from code review
Co-authored-by: Matt Stauffer <mattstauffer@users.noreply.github.com>
2022-03-29 08:56:01 +06:00
Nasir Uddin Nobin
9a9f73faf9 Update cli/Valet/Brew.php 2022-03-24 18:21:50 +06:00
NasirNobin
23aebbe1d9 StyleCI Patch 2022-03-24 05:17:13 +06:00
Nasir Uddin Nobin
6d3d191f44 [wip] Valet run/refactor with brew opt (#9) 2022-03-24 05:15:45 +06:00
NasirNobin
6f085bc70e StyleCI Patch 2022-03-23 04:13:00 +06:00
Nasir Uddin Nobin
faeee5eb9a Apply suggestions from code review 2022-03-23 02:02:49 +06:00
NasirNobin
ca2924daca Self code review 2022-03-23 01:35:30 +06:00
NasirNobin
720fed1a43 refactor code & tests 2022-03-22 19:07:45 +06:00
NasirNobin
1824ae4989 wip 2022-03-22 16:25:26 +06:00
NasirNobin
4f098a8028 refactor with which-php command 2022-03-22 15:26:53 +06:00
NasirNobin
09f3d3e392 wip 2022-03-22 02:02:12 +06:00
NasirNobin
b7880793a9 wip 2022-03-22 01:52:51 +06:00
NasirNobin
3d85b44e6a wip 2022-03-22 01:47:37 +06:00
NasirNobin
794fbc0c57 wip 2022-03-22 01:10:06 +06: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
Cristian Calara
70335bade8 Fix styleci & drop typehint for php5.6 compatibility 2022-01-08 11:05:41 +02: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
Matt Stauffer
18b5ed08f3 Merge pull request #1111 from caelumek/master
Set Brew PHP latest version to 8.1
2021-12-06 12:06:37 -05:00
Taylor Otwell
101abeae0e Apply fixes from StyleCI 2021-12-06 10:40:37 +00:00
Bartosz Piotr Pazola
b92592d6be Set Brew PHP latest version to 8.1 2021-11-29 11:26:26 +01:00
Chris Brown
c549c1786a Stop non-root homebrew services during restarts
This is intended to assist with avoiding having competing non-root instances of valet dependency services running due to userland use of brew CLI commands.

Now, when running `valet stop` or `valet restart` it will (silently) attempt to stop the non-root instance (ignoring any errors thrown), before stopping (and/or starting) the sudo/root instance which is normally used.

(Though obvious, I'll point out that this only applies to services Valet manages.)

Fixes #1057
2021-06-13 01:33:22 -04:00
Matt Stauffer
04d42b3895 Merge pull request #1008 from drbyte/valet-use-improvements
Improvements to "valet use" command
2020-11-29 22:49:25 -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
9da8e96d87 Specify 8.0 as latest PHP version
Specify 8.0 as latest PHP version
This is used mainly for new installs
2020-11-28 23:12:29 -05:00
soilSpoon
cbb59c2251 Update brew list command to remove deprecation warning 2020-11-27 22:21:27 +09: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
soilSpoon
6a4cb74392 Modify php binary path to be based on brew prefix 2020-11-14 21:42:13 +09:00
Miguel Piedrafita
778a877fdf Support php@8.0 and php@8.1 2020-10-28 15:16:18 +00: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
lee
bfd2f3ea5d Updated SUPPORTED_PHP_VERSIONS and LATEST_PHP_VERSION constants to 7.4 2019-11-29 23:06:20 +01:00
Chris Brown
fee6fec141 Fix "sudo: sorry, you are not allowed to preserve the environment" messages
If you've previously run `valet trust` to allow valet to run without specifying `sudo` repeatedly or entering your password with various valet commands, recent updates to MacOS may give you a `sudo: sorry, you are not allowed to preserve the environment` response when trying to run those `valet` commands.

The fix is in updating the sudoers entry that `valet trust` creates.

This PR tells valet how to update the sudoers entry so that this message doesn't continue.

YOU WILL NEED TO RE-RUN `valet trust` IF YOU HAD PREVIOUSLY RUN IT, after installing this update, in order for this code change to have any effect.

(Technical explanation: the sudoers protections have become stricter, so we have to be more explicit that we do indeed want environment variables to flow through to the sudo user's environment when using valet via sudoers entries.)
2019-05-14 16:55:27 -04:00
James Barnard
e5e7c74f1d use formula to restart php instead of version 2019-01-29 12:29:28 -05:00
James Barnard
0bf3078220 update to unlink not the current version but the currently linked formula path (handles bug with latest version under php path) 2019-01-28 20:26:13 -05:00
James Barnard
ece3a1ff2f clean up to remove search, refactor to better handle versions using regex 2019-01-28 20:26:13 -05:00
James Barnard
6158e5129b add more tests for new methods and bits of clean up 2019-01-28 20:26:13 -05:00
James Barnard
25c4fab2b4 stop running php and search brew for php to verify can install it before trying the wrong formula, todos for tests 2019-01-28 20:26:13 -05:00
James Barnard
28748baa80 working on php version and tests 2019-01-28 20:26:13 -05:00
Chris Brown
83b1b2c467 Rework PHP version resolution
Last year's Homebrew's PHP packaging changes altered their version numbering strategy.
Now that their changes appear to have stabilized, Valet also needs some updates to match.

The `linkedPhp()` function was parsing the symlinked directory name for where the php binaries are stored, but that numbering strategy has morphed over time.

This PR changes the logic to accommodate the most common directory naming strategies I can find, including those of older installs.
I've included some examples of these names in code comments for future reference since finding a variety of them can be complicated.
2019-01-09 14:28:43 -05:00
Till Krüss
b3ce1c4a15 Support PHP 7.3 2018-12-07 16:21:43 -05:00
Sahib J. Leo
b05c773e1d Addressing issue #678 2018-12-05 09:00:59 -05:00