mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 08:40:09 +01:00
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
This commit is contained in:
@@ -462,15 +462,14 @@
|
||||
/**
|
||||
* Allow the user to change the version of php valet uses
|
||||
*/
|
||||
$app->command('use [phpVersion]', function ($phpVersion) {
|
||||
$app->command('use [phpVersion] [--force]', function ($phpVersion, $force) {
|
||||
if (!$phpVersion) {
|
||||
return info('Valet is using ' . Brew::linkedPhp());
|
||||
}
|
||||
|
||||
PhpFpm::validateRequestedVersion($phpVersion);
|
||||
|
||||
PhpFpm::stopRunning();
|
||||
$newVersion = PhpFpm::useVersion($phpVersion);
|
||||
$newVersion = PhpFpm::useVersion($phpVersion, $force);
|
||||
|
||||
Nginx::restart();
|
||||
info(sprintf('Valet is now using %s.', $newVersion) . PHP_EOL);
|
||||
|
||||
Reference in New Issue
Block a user