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

63 Commits

Author SHA1 Message Date
Saibotk
0525673051 fix(php-fpm): correct socket creation
While my PR #1514 fixed recreating the FPM configs, it introduced a different issue:

Due to the use of `utilizedPhpVersions()`, the code now also configured the FPM config for the alias `php` version.
This caused it to invoke the configure function with an empty version string and thus overwriting the FPM config for (in my case) the php@8.4 config templated with `valet.sock` instead of the correct `valet84.sock`.

The nginx sites that were configured to proxy their requests to the `valet84.sock` then failed because it did not exist anymore.

We fixed this by always including the actual linked PHP version via the `linkedPhp` function. This returns `php8.4` instead of `php`.

`php` is an alias anyway and this also removes another unnecessary service restart call. Previously, this would also try to restart the `php` service via brew which was already restarted through the restart of `php@8.4`, which is an alias in brew.

This also fixes an issue with the previous PR, to correctly symlink `valet.sock` again to the linked PHP version, which we oversaw.
2025-04-25 23:03:44 +02:00
mattstauffer
76ece5380a Fix code styling 2024-11-25 17:14:52 +00:00
mattstauffer
e75f238b22 Fix code styling 2023-12-21 03:25:35 +00:00
mattstauffer
9a4a7a1693 Fix code styling 2023-08-27 02:47:47 +00:00
driesvints
c1ef300469 Fix code styling 2023-07-21 03:30:59 +00:00
StyleCI Bot
486fb9b339 Apply fixes from StyleCI 2022-12-22 00:54:25 +00:00
Matt Stauffer
20f48f6eab Replace some \n with PHP_EOL; move custom drivers into Custom namespace 2022-12-21 19:54:13 -05:00
Matt Stauffer
ac4b8f6f40 Add type hints and return types to PhpFpm 2022-12-20 12:13:34 -05:00
Dries Vints
a0e1e02a47 Test Valet commands (#1256)
* First attempt at testing CLI commands

* Apply fixes from StyleCI

* Protect from running locally

* Fix test

* wip

* wip

* wip

* wip

* wip

* Update app.php

* Create config folder and files for CLI tests

* Apply fixes from StyleCI

* Fix some formatting

* Fix imports

* Update all output() calls to use the writer passed in by the command

Ugly capture of all $outputs from commands, by passing them into `writer()` to be bound into the container, where they can then be pulled out from calls to `output()` and its buddies `info()`, `table()`, and `warning()`.

* Apply fixes from StyleCI

* Flesh out park command test

* Apply fixes from StyleCI

* Drop php 7.0 and 7.1

Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Matt Stauffer <matt@tighten.co>
2022-12-02 09:32:28 +01:00
NasirNobin
0267da704e remove preg_replace deprecation warning 2022-04-16 18:47:38 +06:00
Michael Lehmkuhl
315af8904a Add PHP version to valet links output table 2022-04-03 18:35:51 -05:00
Matt Stauffer
7532acef8c Merge branch 'mes/pass-site-to-isolate-commands' of github.com:laravel/valet into mes/pass-site-to-isolate-commands 2022-03-21 01:34:45 -04:00
Matt Stauffer
6dd536c987 Fix isolation test for CI 2022-03-21 01:34:41 -04:00
StyleCI Bot
94353bc940 Apply fixes from StyleCI 2022-03-21 05:25:37 +00: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
a31fa01931 test for - default www pools disabling 2022-03-16 21:32:01 +06: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
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
021dfe9fa7 Merge branch 'mes/symlink-valet-socks' of github.com:laravel/valet into mes/symlink-valet-socks 2022-03-14 13:59:00 -04:00
Matt Stauffer
17cda5dc79 Drop todos 2022-03-14 13:58:52 -04:00
StyleCI Bot
791a047576 Apply fixes from StyleCI 2022-03-14 17:57:55 +00:00
Matt Stauffer
ce4682f897 Fix PHPFpm tests
- Fix the isolated directories test given new table shape
- Updated useVersion test to no longer hit the real filesystem

Co-Authored-By: Jacob Baker-Kretzmar <18192441+bakerkretzmar@users.noreply.github.com>
2022-03-14 13:57:45 -04:00
Matt Stauffer
8590d8eebb Merge 2022-03-14 12:47:07 -04:00
Matt Stauffer
3cdb7c78f4 Drop space before colon in magic isolation string 2022-03-14 12:42:11 -04:00
StyleCI Bot
38a19291ce Apply fixes from StyleCI 2022-03-14 16:41:13 +00:00
Matt Stauffer
8f7ea041b6 Test isolatedDirectories 2022-03-14 12:41:04 -04:00
Matt Stauffer
95aa03977c Add command to list isolated sites 2022-03-14 00:16:36 -04:00
Matt Stauffer
148eb0174d Drop test coverage for deprecated method 2022-03-13 22:29:09 -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
51742b3795 Make primary valet.sock a symlink to an existing version 2022-03-12 23:29:01 -05:00
Matt Stauffer
592354877d Rename isolateDirectory 2022-03-12 22:28:25 -05:00
Matt Stauffer
33c797f9ef Drop need to pass sock to isolate command 2022-03-12 00:20:40 -05: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
7a80a2e0ea Apply suggestions from code review
Co-authored-by: Matt Stauffer <mattstauffer@users.noreply.github.com>
2022-02-19 08:16:16 +06:00
Nasir Uddin Nobin
9a5d30bb69 Tests for Parallel PHP Version Support 2022-02-18 15:14:57 +06:00
Nasir Uddin Nobin
5c1043776e Apply refactor & cleanup from the code review 2022-02-15 16:44:29 +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
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
0b341a7ca1 Update test suite to phpunit 9.5
Update test suite to phpunit 9.5 syntax
Refactored to use polyfill for older PHP versions via `yoast/phpunit-polyfills`

Note: this includes 2 important differences from usual phpunit test suites:
- instead of extending `PHPUnit\Framework\TestCase` we extend `Yoast\PHPUnitPolyfills\TestCases\TestCase`
- instead of handling fixtures via `setUp()` and `tearDown()` we use `set_up()` and `tear_down()` respectively

Comment regarding formatting: I chose to use the FQDN in the `extends` syntax of the class declaration instead of using `use` so that it is more quickly apparent that we're doing something slightly different than usual phpunit syntax, particularly in regards to the set_up() / tear_down() methods that appear immediately following the `extends` line.
2020-11-29 12:10:05 -05:00
Chris Brown
7d98b24330 Update tests for valet-use improvements 2020-11-28 23:52:28 -05:00
CodeLingoBot
21f479884b Fix case of contants based on best practices from PSR2
Signed-off-by: CodeLingoBot <bot@codelingo.io>
2019-04-01 10:51:16 +13: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
6a5c06e934 add tests for use version and return the found version to output 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