Commit 4dc7f944 authored by Taylor Otwell's avatar Taylor Otwell

Refactor the configuration class.

parent 86fde936
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment