mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 08:10:07 +01:00
Read .valetphprc on isolation command (#6)
* Read .valetphprc on isolation command * wip * wip * wip * remove $site->getSiteUrl() dependency to avoid expection * StyleCI patch
This commit is contained in:
@@ -508,7 +508,15 @@
|
||||
if (! $phpVersion) {
|
||||
$site = basename(getcwd());
|
||||
$linkedVersion = Brew::linkedPhp();
|
||||
$phpVersion = Site::phpRcVersion($site);
|
||||
|
||||
if ($phpVersion = Site::phpRcVersion($site)) {
|
||||
info("Found '{$site}/.valetphprc' specifying version: {$phpVersion}");
|
||||
} else {
|
||||
$domain = $site.'.'.data_get(Configuration::read(), 'tld');
|
||||
if ($phpVersion = PhpFpm::normalizePhpVersion(Site::customPhpVersion($domain))) {
|
||||
info("Found isolated site '{$domain}' specifying version: {$phpVersion}");
|
||||
}
|
||||
}
|
||||
|
||||
if (! $phpVersion) {
|
||||
return info("Valet is using {$linkedVersion}.");
|
||||
@@ -517,8 +525,6 @@
|
||||
if ($linkedVersion == $phpVersion && ! $force) {
|
||||
return info("Valet is already using {$linkedVersion}.");
|
||||
}
|
||||
|
||||
info("Found '{$site}/.valetphprc' specifying version: {$phpVersion}");
|
||||
}
|
||||
|
||||
PhpFpm::useVersion($phpVersion, $force);
|
||||
@@ -534,6 +540,11 @@
|
||||
$site = basename(getcwd());
|
||||
}
|
||||
|
||||
if (! $phpVersion) {
|
||||
$phpVersion = Site::phpRcVersion($site);
|
||||
info("Found '{$site}/.valetphprc' specifying version: {$phpVersion}");
|
||||
}
|
||||
|
||||
PhpFpm::isolateDirectory($site, $phpVersion);
|
||||
})->descriptions('Change the version of PHP used by Valet to serve the current working directory', [
|
||||
'phpVersion' => 'The PHP version you want to use; e.g php@8.1',
|
||||
|
||||
Reference in New Issue
Block a user