From e504c3ac44de7fd07bcc6609852a01a8cf46bc2c Mon Sep 17 00:00:00 2001 From: Seven Du Date: Mon, 23 Jul 2018 10:36:28 +0800 Subject: [PATCH] fix(core): Fixed non-loaded timezone and app env --- app/Bootstrap/LoadConfiguration.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Bootstrap/LoadConfiguration.php b/app/Bootstrap/LoadConfiguration.php index 2d85fff2d..0ab14908c 100644 --- a/app/Bootstrap/LoadConfiguration.php +++ b/app/Bootstrap/LoadConfiguration.php @@ -55,5 +55,14 @@ public function handle() $this->app->config->set( $this->configuration->getConfigurationBase() ); + $config = $this->app->config; + + $this->app->detectEnvironment(function () use ($config) { + return $config->get('app.env', 'production'); + }); + + date_default_timezone_set($config->get('app.timezone', 'UTC')); + + $loaded = true; } }