diff --git a/laravel/bootstrap/core.php b/laravel/bootstrap/core.php index 8264bce7..26e25614 100644 --- a/laravel/bootstrap/core.php +++ b/laravel/bootstrap/core.php @@ -41,7 +41,26 @@ */ if (isset($_SERVER['LARAVEL_ENV'])) { - Config::glance(CONFIG_PATH.$_SERVER['LARAVEL_ENV'].'/'); + define('ENV_CONFIG_PATH', CONFIG_PATH.$_SERVER['LARAVEL_ENV'].'/'); + + Config::glance(ENV_CONFIG_PATH); +} + +/** + * Load some core configuration files by default so we don't have to + * let them fall through the Config loader. This will allow us to + * load these files faster for each request. + */ +foreach (array('application', 'session', 'aliases') as $file) +{ + $config = require CONFIG_PATH.$file.EXT; + + if (isset($_SERVER['LARAVEL_ENV'])) + { + $config = array_merge($config, require ENV_CONFIG_PATH.$file.EXT); + } + + Config::$items[$file] = $config; } /** diff --git a/laravel/config.php b/laravel/config.php index 525992e3..3f038a1c 100644 --- a/laravel/config.php +++ b/laravel/config.php @@ -16,7 +16,7 @@ class Config { * * @var array */ - protected static $items = array(); + public static $items = array(); /** * Determine if a configuration item or file exists.