diff --git a/cli-script.php b/cli-script.php index e979d96c2..cb88be8e5 100755 --- a/cli-script.php +++ b/cli-script.php @@ -2,8 +2,8 @@ // CLI specific bootstrapping use SilverStripe\Control\CLIRequestBuilder; +use SilverStripe\Control\HTTPApplication; use SilverStripe\Core\CoreKernel; -use SilverStripe\Core\HTTPApplication; require __DIR__ . '/src/includes/autoload.php'; diff --git a/src/Core/CoreKernel.php b/src/Core/CoreKernel.php index d2388dce4..df3339b18 100644 --- a/src/Core/CoreKernel.php +++ b/src/Core/CoreKernel.php @@ -186,6 +186,16 @@ class CoreKernel implements Kernel $this->bootManifests($flush); $this->bootErrorHandling(); $this->bootDatabase(); + $this->bootConfigs(); + } + + /** + * Include all _config.php files + */ + protected function bootConfigs() + { + // After loading all other app manifests, include _config.php files + $this->getModuleLoader()->getManifest()->activateConfig(); } /** @@ -436,9 +446,6 @@ class CoreKernel implements Kernel } } - // After loading config, boot _config.php files - $this->getModuleLoader()->getManifest()->activateConfig(); - // Find default templates $defaultSet = $this->getThemeResourceLoader()->getSet('$default'); if ($defaultSet instanceof ThemeManifest) { diff --git a/src/ORM/DB.php b/src/ORM/DB.php index 81b263d4f..7049160bd 100644 --- a/src/ORM/DB.php +++ b/src/ORM/DB.php @@ -316,7 +316,7 @@ class DB * @param string $name * @return mixed */ - public static function getConfig($name) + public static function getConfig($name = 'default') { if (isset(static::$configs[$name])) { return static::$configs[$name]; diff --git a/tests/behat/serve-bootstrap.php b/tests/behat/serve-bootstrap.php index e392dfd9e..71cc7965e 100644 --- a/tests/behat/serve-bootstrap.php +++ b/tests/behat/serve-bootstrap.php @@ -2,4 +2,3 @@ require __DIR__ . '/../bootstrap/init.php'; require __DIR__ . '/../bootstrap/environment.php'; -require __DIR__ . '/../bootstrap/mysite.php';