From 112b895d565c10d27efdd41281c418aa3ed59941 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 29 Sep 2016 11:48:04 +0300 Subject: [PATCH] Add option not to set environment (CLI) --- system/src/Grav/Common/Config/Setup.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/src/Grav/Common/Config/Setup.php b/system/src/Grav/Common/Config/Setup.php index c613b9f7bd..bb15ca6246 100644 --- a/system/src/Grav/Common/Config/Setup.php +++ b/system/src/Grav/Common/Config/Setup.php @@ -133,7 +133,7 @@ class Setup extends Data */ public function __construct($container) { - $environment = static::$environment ?: ($container['uri']->environment() ?: 'localhost'); + $environment = isset(static::$environment) ? static::$environment : ($container['uri']->environment() ?: 'localhost'); // Pre-load setup.php which contains our initial configuration. // Configuration may contain dynamic parts, which is why we need to always load it. @@ -150,8 +150,8 @@ public function __construct($container) parent::__construct($setup); // Set up environment. - $this->def('environment', $environment); - $this->def('streams.schemes.environment.prefixes', ['' => ["user://{$this->environment}"]]); + $this->def('environment', $environment ?: 'cli'); + $this->def('streams.schemes.environment.prefixes', ['' => ($environment ? ["user://{$this->environment}"] : [])]); } /**