improved config loading performance.
This commit is contained in:
parent
4edcc321aa
commit
845bdc58fa
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,7 +16,7 @@ class Config {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $items = array();
|
||||
public static $items = array();
|
||||
|
||||
/**
|
||||
* Determine if a configuration item or file exists.
|
||||
|
|
Loading…
Reference in New Issue