diff --git a/config-stubs/app.php b/config-stubs/app.php index e71a9cc8..9a78a224 100755 --- a/config-stubs/app.php +++ b/config-stubs/app.php @@ -65,7 +65,7 @@ | */ - 'timezone' => get_option('timezone_string') ?: env('APP_TIMEZONE', 'UTC'), + 'timezone' => env('APP_TIMEZONE', 'UTC'), /* |-------------------------------------------------------------------------- diff --git a/config/app.php b/config/app.php index eefab381..d62408ad 100755 --- a/config/app.php +++ b/config/app.php @@ -72,7 +72,7 @@ | */ - 'timezone' => get_option('timezone_string') ?: env('APP_TIMEZONE', 'UTC'), + 'timezone' => env('APP_TIMEZONE', 'UTC'), /* |-------------------------------------------------------------------------- diff --git a/src/Roots/Acorn/Bootstrap/LoadConfiguration.php b/src/Roots/Acorn/Bootstrap/LoadConfiguration.php new file mode 100644 index 00000000..5e1e4cee --- /dev/null +++ b/src/Roots/Acorn/Bootstrap/LoadConfiguration.php @@ -0,0 +1,43 @@ +getCachedConfigPath())) { + $items = require $cached; + + $app->instance('config_loaded_from_cache', $loadedFromCache = true); + } + + // Next we will spin through all of the configuration files in the configuration + // directory and load each one into the repository. This will make all of the + // options available to the developer for use in various parts of this app. + $app->instance('config', $config = new Repository($items)); + + if (! isset($loadedFromCache)) { + $this->loadConfigurationFiles($app, $config); + } + + // Finally, we will set the application's environment based on the configuration + // values that were loaded. We will pass a callback which will be used to get + // the environment in a web context where an "--env" switch is not present. + $app->detectEnvironment(fn () => $config->get('app.env', 'production')); + } +} diff --git a/src/Roots/Acorn/Console/Kernel.php b/src/Roots/Acorn/Console/Kernel.php index 7675cd15..f07f0e84 100644 --- a/src/Roots/Acorn/Console/Kernel.php +++ b/src/Roots/Acorn/Console/Kernel.php @@ -57,7 +57,7 @@ class Kernel extends FoundationConsoleKernel */ protected $bootstrappers = [ \Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables::class, - \Illuminate\Foundation\Bootstrap\LoadConfiguration::class, + \Roots\Acorn\Bootstrap\LoadConfiguration::class, \Roots\Acorn\Bootstrap\HandleExceptions::class, \Roots\Acorn\Bootstrap\RegisterFacades::class, \Illuminate\Foundation\Bootstrap\SetRequestForConsole::class, diff --git a/src/Roots/Acorn/Http/Kernel.php b/src/Roots/Acorn/Http/Kernel.php index fe7ae482..70575527 100644 --- a/src/Roots/Acorn/Http/Kernel.php +++ b/src/Roots/Acorn/Http/Kernel.php @@ -13,7 +13,7 @@ class Kernel extends HttpKernel */ protected $bootstrappers = [ \Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables::class, - \Illuminate\Foundation\Bootstrap\LoadConfiguration::class, + \Roots\Acorn\Bootstrap\LoadConfiguration::class, \Roots\Acorn\Bootstrap\HandleExceptions::class, \Roots\Acorn\Bootstrap\RegisterFacades::class, \Illuminate\Foundation\Bootstrap\RegisterProviders::class,