-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🩹 Do not set PHP timezone when bootstrapping configuration (#428)
- Loading branch information
Showing
5 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace Roots\Acorn\Bootstrap; | ||
|
||
use Illuminate\Config\Repository; | ||
use Illuminate\Contracts\Foundation\Application; | ||
use Illuminate\Foundation\Bootstrap\LoadConfiguration as FoundationLoadConfiguration; | ||
|
||
class LoadConfiguration extends FoundationLoadConfiguration | ||
{ | ||
/** | ||
* Bootstrap the given application. | ||
* | ||
* @return void | ||
*/ | ||
public function bootstrap(Application $app) | ||
{ | ||
$items = []; | ||
|
||
// First we will see if we have a cache configuration file. If we do, we'll load | ||
// the configuration items from that file so that it is very quick. Otherwise | ||
// we will need to spin through every configuration file and load them all. | ||
if (file_exists($cached = $app->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')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters