mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 08:10:07 +01:00
Add command to list isolated sites
This commit is contained in:
@@ -243,6 +243,22 @@ public function unIsolateDirectory($directory)
|
||||
info(sprintf('The site [%s] is now using the default PHP version.', $site));
|
||||
}
|
||||
|
||||
/**
|
||||
* List all directories with PHP isolation configured.
|
||||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function isolatedDirectories()
|
||||
{
|
||||
$configuredSites = $this->nginx->configuredSites();
|
||||
|
||||
return $configuredSites->filter(function ($item) {
|
||||
return str_contains($this->files->get(VALET_HOME_PATH.'/Nginx/'.$item), 'Valet isolated PHP version');
|
||||
})->map(function ($item) {
|
||||
return ['url' => $item];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Use a specific version of PHP globally.
|
||||
*
|
||||
@@ -366,11 +382,7 @@ public function utilizedPhpVersions()
|
||||
return self::fpmSockName($this->normalizePhpVersion($version));
|
||||
})->unique();
|
||||
|
||||
return collect($this->files->scandir(VALET_HOME_PATH.'/Nginx'))
|
||||
->reject(function ($file) {
|
||||
return starts_with($file, '.');
|
||||
})
|
||||
->map(function ($file) use ($fpmSockFiles) {
|
||||
return $this->nginx->configuredSites()->map(function ($file) use ($fpmSockFiles) {
|
||||
$content = $this->files->get(VALET_HOME_PATH.'/Nginx/'.$file);
|
||||
|
||||
// Get the normalized PHP version for this config file, if it's defined
|
||||
|
||||
Reference in New Issue
Block a user