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

53 Commits

Author SHA1 Message Date
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
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
Jesus Urrutia
b52ae454a2 Maintain compatibility with the old name of the PHP version 2018-04-09 11:20:19 -03:00
Jesus Urrutia
b71b580545 Fix supportedPhpVersions method use constant 2018-04-07 16:27:16 -03:00
Jesus Urrutia
1dd83f133b Unify php versions list. Fix deprecated homebrew/php 2018-04-06 18:52:46 -03:00
Rob van Hoose
2afc61cc6c Fix (really) changes where brew php paths now include @ and semver-style versions in paths 2018-04-04 11:41:59 -04:00
Taylor Otwell
5d74ad18cb Revert "fix for new php versions/paths from php installed via brew" (#551)
* Revert "wip"

This reverts commit 15c961e41e.

* Revert "fix changes where brew php paths now include @ and semver-style versions in paths (#545)"

This reverts commit 7f61475feb.
2018-04-03 11:38:18 -07:00
James Doyle
7f61475feb fix changes where brew php paths now include @ and semver-style versions in paths (#545) 2018-04-03 07:06:10 -07:00
Ed Preston
be8fb05110 Update Brew.php - Homebrew\Core Package Names (#549)
Update supportedPhpVersions to include the new names used by homebrew now that the php packages have migrated to 'core'.   php71 has become php@7.1 etc

The new names are put at the front of the list to optimise the loops that use these collections.

Anyone who installs or updates 'homebrew php' from will start using the new packages names which breaks parts of valet.
2018-04-03 07:05:22 -07:00
Taylor Otwell
884753b75e fixes 2018-03-02 08:25:57 -06:00
Adam Wathan
740d716cdd Accommodate formula name change in latest homebrew 2018-03-02 07:30:26 -05:00
Matt Stauffer
6587fb53a5 Add 'trust' command 2018-01-04 16:36:16 -05:00
Adam Wathan
84ade711b6 Refactor to collections 2017-06-22 07:34:51 -04:00
Korvin Szanto
ba7017a56b Add PHP72 to detectable PHP versions
Should we do this with a preg_match instead? `preg_match('~php(56|7[0-9])~', $matches)`
2017-06-19 14:28:56 -07:00
Adam Wathan
ba0a3ba4e7 Merge pull request #263 from antonioribeiro/showStartStopInfo
Show start & stop process info in terminal
2017-03-23 10:45:26 -04:00
Adam Wathan
9cae383c0d Use curly braces in string interpolation 2017-03-23 09:00:34 -04:00
Leon Jacobs
85c439b8c0 Remove sudoers entries 2017-03-04 16:53:49 +02:00
Antonio Carlos Ribeiro
6f8c14271a Show install, start, stop and restart log info 2017-02-21 12:04:45 -03:00
Adam Wathan
f98db814c6 Merge branch 'master' into master 2017-02-20 09:18:39 -05:00
Adam Wathan
3027a0dbba Explicitly stop and start brew services instead of restart
This solves a mysterious issue that may or may not be specific to my
machine and it makes me very sad.
2017-01-21 12:00:05 -05:00
Pierre-Luc Brunet
fa0456ea8f Uses the correct service name if nginx-full is installed instead of nginx 2017-01-04 14:45:44 -05:00
Pierre-Luc Brunet
976561a2bf Fix for issue #250 - brew package nginx-full not properly recognized as a valid nginx installation 2017-01-04 14:27:18 -05:00
Chris Brown
e208ca2340 Update minimum PHP requirement to 5.6
... because it's not actually compatible with 5.5 anymore - Ref: https://github.com/laravel/valet/issues/279
2016-12-27 15:58:16 -05:00
Michaël Lecerf
d325eeca16 Fix typo in docblock 2016-12-11 22:50:30 +01:00
Adam Wathan
3d0e099755 Remove grim array type hints 2016-12-08 08:32:55 -05:00
Taylor Otwell
fba8eb7602 fix nginx support 2016-12-08 08:32:55 -05:00
Adam Lavin
b2878a6d1a Update brew list to use runAsUser instead of directly sudoing 2016-11-23 21:52:56 +00:00
Adam Lavin
6aa1f4b7bf Run brew list as user
As brew no longer allows running itself as root, we need to run it at the current user. This resolves #221.
2016-11-23 16:29:27 +00:00
Chris Brown
77cd98f4cc Add basic changes to alllow php71 2016-07-28 12:36:15 -04:00
Taylor Otwell
24039873f2 Fix brew installations. 2016-05-17 19:38:53 -07:00
Daniel Morris
fe6fb947f7 Consistency changes (#60)
* Correct the return type annotation in a serves method

* Type-hint the driver in the abstract ValetDriver

* Correct the return type-hint in the sample ValetDriver

* Remove the return afrom the restartLinkedPhp method

* Remove the return annotation from the Caddy constructor

* Remove the return annotation from the Valet configuration constructor

* Removed the return from the prependPath method of the Configuration class

* Removed the return from the appendAsUser method of the Filesystem class

* Removed the return annotation from the Site constructor

* Corrected the parameter annotation of the link method in the Site class

* Order use statements by length in PhpFpm

* Remove the return annotation from the Valet constructor
2016-05-12 21:17:32 -05:00
Taylor Otwell
f48b6c7563 combine vars 2016-05-11 19:49:17 -05:00
Taylor Otwell
fbe2fe6fac Tweaking a few things. 2016-05-11 15:22:20 -05:00
Glendon Solsberry
e714082d50 Allows Valet to run under PHP 5.5 (#57)
* Allows for valet to run under PHP 5.5 as well.

Add checks for php55 to the mix.

* Allows for valet to run under PHP 5.5 as well.

Add checks for php55 to the mix.

* Update .travis.yml

* Update PhpFpm.php

* Add tests for php55
2016-05-10 21:56:25 -05:00