added support for environment driven configuration files.

This commit is contained in:
Taylor Otwell 2011-07-25 22:01:17 -05:00
parent 5a43f29f31
commit c9698df285
1 changed files with 3 additions and 1 deletions

View File

@ -100,7 +100,9 @@ private static function parse($key)
*/ */
public static function load($file) public static function load($file)
{ {
if ( ! array_key_exists($file, static::$items) and file_exists($path = APP_PATH.'config/'.$file.EXT)) $directory = (isset($_ENV['LARAVEL_ENV'])) ? $_ENV['LARAVEL_ENV'].'/' : '';
if ( ! array_key_exists($file, static::$items) and file_exists($path = APP_PATH.'config/'.$directory.$file.EXT))
{ {
static::$items[$file] = require $path; static::$items[$file] = require $path;
} }