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

detect preferred site with introducing a new variable

This commit is contained in:
Sandro Gehri
2020-11-23 23:38:40 +01:00
parent 63dce63a29
commit e1aeb0b2ce

View File

@@ -126,7 +126,6 @@ function valet_default_site_path($config)
* Inspects registered path directories, case-sensitive.
*/
$valetSitePath = null;
$valetSitePathByDomain = null;
$domain = array_slice(explode('.', $siteName), -1)[0];
foreach ($valetConfig['paths'] as $path) {
@@ -141,15 +140,13 @@ function valet_default_site_path($config)
break;
}
if (strtolower($file) === $domain) {
$valetSitePathByDomain = $path.'/'.$file;
$valetSitePath = $path.'/'.$file;
}
}
closedir($handle);
}
}
$valetSitePath = $valetSitePath ?: $valetSitePathByDomain;
if (is_null($valetSitePath) && is_null($valetSitePath = valet_default_site_path($valetConfig))) {
show_valet_404();
}