1
0
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:
NasirNobin
2022-04-01 00:25:46 +06:00
committed by GitHub
parent 9e46ace983
commit fa0bd53d12

View File

@@ -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',