From c9698df285d22914bb1f4f9e9b4f1454ab7c06f1 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 25 Jul 2011 22:01:17 -0500 Subject: [PATCH] added support for environment driven configuration files. --- system/config.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/system/config.php b/system/config.php index af8360c3..f4c3f291 100644 --- a/system/config.php +++ b/system/config.php @@ -100,7 +100,9 @@ private static function parse($key) */ 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; }