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

101 Commits

Author SHA1 Message Date
Chris Brown
615d61dc8e Install older PHP versions via alternate tap
Fixes #1407

Homebrew's support policy now aggressively disables older versions earlier than it did previously.
That is why we tap the `shivammathur/php` repository.

But since Homebrew also now "keeps" those old formulae but marks them as disabled, when Valet runs `brew install php@7.4` it fails because Homebrew just aborts due to its flags in the outdated formula.
(They mark it as "disabled" and/or "keg_only :versioned_formula", but don't actually delete the formula from their repository.)
To override that we must use `brew install shivammathur/php/php@7.4` internally.

Therefore, we need to maintain a list of which PHP Versions we wish to specifically prefix with the `shivammathur/php` tap in order to bypass Homebrew's flags.

**ANNUAL MAINTENANCE**
1. This PR adds the array of `LIMITED_PHP_VERSIONS` which we will have to update annually when new PHP versions are retired as others are released.
2. We should also annually update the `LATEST_PHP_VERSION` string.
2023-05-05 22:17:42 -04:00
Matt Stauffer
8784458dfe Drop "superfluous" phpdoc tags (per Pint) 2023-02-18 23:20:03 -05:00
Matt Stauffer
6a920bd5a9 Merge Pint config 2023-02-13 15:39:44 -05:00
driesvints
cda928d1ed Fix code styling 2023-02-13 17:06:56 +00:00
Matt Stauffer
8ba65d6a68 Drop PHP 7.0, and update Magento driver to support PHP 7.3 2023-01-18 16:51:44 -05:00
Matt Stauffer
921f68a3ae Support PHP 7.0+ (#1346)
* Get PHP executable for a PHP 8+ version even if linked PHP is below 8

This allows users to run PHP 7.4 (haven't tested in below 7.4) while the codebase is PHP 8+.

* Apply fixes from StyleCI

* Return correct path for linked PHP

* Apply fixes from StyleCI

* Add PHP@7.2 support

* Add support for PHP 7.0-7.2

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-01-18 16:39:21 -05:00
Matt Stauffer
303462ffd1 Add Expose support, drop ngrok binary and move it to be managed by Brew, drop copying ngrok share URL to clipbaord
* Extract basic driver with public/ from basic driver, and simplify both

* Apply fixes from StyleCI

* Set HTTP_HOST in BaseDriverTest

* Move server helpers to their own file; add type hints

* Update drivers location and loading

- Extract much of server.php into a `Server` class
- Move all but the Laravel and Basic drivers into a subfolder
- Load all but the Laravel and Basic drivers via glob
- Add `beforeLoading` hook to simplify the `frontControllerPath` method for some drivers

* Apply fixes from StyleCI

* Add additional notes to upgrade.md

* Apply fixes from StyleCI

* Require PHP 8.0

* Add type hints and return type hints to Brew

* Apply fixes from StyleCI

* Add type hints and return type hints to CommandLine

* Add type hints and return type hints to Configuration

* Add type hints and return type hints to Diagnose

* Apply fixes from StyleCI

* Add type hints and return type hints to DnsMasq

* Add type hints and return hints to Filesystem

* Add type hints and return types to Nginx

* Add type hints and return types to ngrok

* Add type hints and return types to PhpFpm

* Apply fixes from StyleCI

* Add type hints and return types to Site and Valet

* Apply fixes from StyleCI

* Require passing a version number to isolate command

* Apply fixes from StyleCI

* Bump compat to php 8; add type hints and return types to helpers

* Apply fixes from StyleCI

* Use constructor promotion

* Apply fixes from StyleCI

* Write tests for Server.php

* Apply fixes from StyleCI

* Move upgrade calls into Upgrader class, and add upgrade to check for old custom drivers

* Apply fixes from StyleCI

* Replace some \n with PHP_EOL; move custom drivers into Custom namespace

* Apply fixes from StyleCI

* Add doc blocks

* Clean up NullWriter; drop legacy config check

* Allow null response from frontControllerPath

* Apply fixes from StyleCI

* Drop exits, fix 404 path

* Better handle new installations

* Apply fixes from StyleCI

* Drop extensions

* Clean up DX for fetch-share-url

* Apply fixes from StyleCI

* Fix site::unlink method signature and docblock

* Tweak the wording for the which command

* Support isolated sites running PHP 7.4

* Add a bunch more CLI command tests (#1332)

* Wip some cli tests

* Apply fixes from StyleCI

* Test parked command

* Test forget command

* Update Filesystem::rmDirAndContents to respect symlinks

* Wip cli commands

* Apply fixes from StyleCI

* Test link command, unlink command, and secure command

* Apply fixes from StyleCI

* Add tests for unsecure, unsecure --all, secured commands

Add placeholders for the remaining CLI commands
Add nginx::restart to unsecure --all command

Co-authored-by: StyleCI Bot <bot@styleci.io>

* Drop old config migrations

* Add status command (#1329)

* Build the foundation of a status command

* Apply fixes from StyleCI

* Wip testing status command

* Apply fixes from StyleCI

* Fix status test

* Apply fixes from StyleCI

* Fix race condition in creating test config file

* Apply fixes from StyleCI

* Reset container for each test

* Differentiate response code based on success or failure of status command

* Apply fixes from StyleCI

* Add the ability to test if a Brew service is running

* Apply fixes from StyleCI

* Check for more services running in status command

* Apply fixes from StyleCI

* Test Status

* Apply fixes from StyleCI

* Drop Yoast from base application test case

Co-authored-by: StyleCI Bot <bot@styleci.io>

* Test most of the remaining CLI commands

* Test set tld command

* Test set loopback command

* Test proxy, unproxy, and proxies commands

* Apply fixes from StyleCI

* Test which command

* Test diagnose command

* Test directory-listing and which-php commands

* Text isolate and unisolate and isolated commands

* Apply fixes from StyleCI

* Test trust command

* Apply fixes from StyleCI

* Test on-latest-version command

* Move uninstall text to a class, and tweak text and presentation

* Apply fixes from StyleCI

* Test use command

* Test stop command

* Test start command

* Test restart command

Co-authored-by: StyleCI Bot <bot@styleci.io>

* Drop unnecessary doc blocks (#1339)

* Drop unnecessary doc blocks

* Apply fixes from StyleCI

Co-authored-by: StyleCI Bot <bot@styleci.io>

* Tweak status output and install output

* Add debug instructions to valet status, expand "valet installed" status check

* Drop extensions directory

* Apply fixes from StyleCI

* Remove more docblocks

* Upgrade ngrok to 3.1.0

* Test force uninstall command

* Test log command

* Drop copying Ngrok share to clipboard; add first steps of Expose code

* Add logic paths for Expose vs. ngrok and the share-tool config

* Apply fixes from StyleCI

* Take the first steps of manually installing ngrok and expose when needed

* Apply fixes from StyleCI

* Next steps Brew-installed ngrok

* Apply fixes from StyleCI

* Add class to represent Composer; continue ngrok + expose updates

* Apply fixes from StyleCI

* Add ensureInstalled() method to Expose and installOrFail() to Composer

* Apply fixes from StyleCI

* Require global PHP 8+ to install

* Exit if invalid domain is passed to valet share

* Update Composer dependencies to use Illuminate/Container

* Drop the idea of passing a custom domain to valet share

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-01-13 21:34:37 -05:00
Matt Stauffer
4c2c4a1238 Drop unnecessary doc blocks (#1339)
* Drop unnecessary doc blocks

* Apply fixes from StyleCI

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-01-11 09:14:39 -05:00
Matt Stauffer
976339f898 Support isolated sites running PHP 7.4 2022-12-26 09:47:58 -05:00
Matt Stauffer
75d43a42ea Use constructor promotion 2022-12-20 21:51:15 -05:00
StyleCI Bot
624e92164f Apply fixes from StyleCI 2022-12-18 21:40:24 +00:00
Matt Stauffer
9b503a2ed3 Add type hints and return type hints to Brew 2022-12-18 15:40:12 -06:00
StyleCI Bot
e02b5f3025 Apply fixes from StyleCI 2022-12-02 01:32:31 +00:00
Matt Stauffer
5b3433e806 Merge branch 'patch-1' of https://github.com/JoshuaBehrens/valet into JoshuaBehrens-patch-1 2022-12-01 20:28:51 -05:00
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
96991252ce Merge branch 'master' into patch-1 2022-03-31 10:29:24 -04: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
Joshua Behrens
5c4f69546d Disable brew auto cleanup on installation 2020-11-19 11:30:40 +01:00