From f332f5bfe43b3db77f3c400e94b9de164e83370e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Klabbers?= Date: Wed, 30 Sep 2020 21:38:19 +0200 Subject: [PATCH] Mark keys for Config required only with InstalledSite (#2323) * use fallback on url to prevent errors in cli during install. The value of the fallback doesn't actually matter, we just need something. --- framework/core/src/Foundation/Site.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/core/src/Foundation/Site.php b/framework/core/src/Foundation/Site.php index c77868467..973214212 100644 --- a/framework/core/src/Foundation/Site.php +++ b/framework/core/src/Foundation/Site.php @@ -25,7 +25,12 @@ class Site date_default_timezone_set('UTC'); if (! static::hasConfigFile($paths->base)) { - return new UninstalledSite($paths, $_SERVER['REQUEST_URI']); + // Instantiate site instance for new installations, + // fallback to localhost for validation of Config for instance in CLI. + return new UninstalledSite( + $paths, + Arr::get($_SERVER, 'REQUEST_URI', 'http://localhost') + ); } return (