From 4dc7f9448c74e7c784d2a5826ba24c066e2f4851 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 8 Aug 2011 13:12:37 -0500 Subject: [PATCH] Refactor the configuration class. --- system/config.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/config.php b/system/config.php index 79c3fc49..e1aa24e4 100644 --- a/system/config.php +++ b/system/config.php @@ -93,6 +93,9 @@ class Config { /** * Load all of the configuration items from a file. * + * Laravel supports environment specific configuration files. So, the base configuration + * array will be loaded first, then any environment specific options will be merged in. + * * @param string $file * @param string $module * @return bool @@ -103,10 +106,8 @@ class Config { $path = ($module === 'application') ? CONFIG_PATH : MODULE_PATH.$module.'/config/'; - // Load the base configuration items from the application directory. $config = (file_exists($base = $path.$file.EXT)) ? require $base : array(); - // Merge any environment specific configuration into the base array. if (isset($_SERVER['LARAVEL_ENV']) and file_exists($path = $path.$_SERVER['LARAVEL_ENV'].'/'.$file.EXT)) { $config = array_merge($config, require $path);