From 21592ec67f9c2a53f5f97694c3a8bba2c305f2c2 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 30 Sep 2011 20:28:45 -0500 Subject: [PATCH] refactoring and tweaking. --- laravel/bootstrap/core.php | 9 +++++++++ laravel/config.php | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/laravel/bootstrap/core.php b/laravel/bootstrap/core.php index 6e68e692..8b763475 100644 --- a/laravel/bootstrap/core.php +++ b/laravel/bootstrap/core.php @@ -35,6 +35,15 @@ require SYS_PATH.'loader'.EXT; require SYS_PATH.'arr'.EXT; +/** + * If a Laravel environment has been specified on the server, we will + * add a path to the configuration manager for the environment. + */ +if (isset($_SERVER['LARAVEL_ENV'])) +{ + Config::glance(CONFIG_PATH.$_SERVER['LARAVEL_ENV'].'/'); +} + /** * Bootstrap the application inversion of control (IoC) container. * The container provides the convenient resolution of objects and diff --git a/laravel/config.php b/laravel/config.php index 0cb52658..619b7005 100644 --- a/laravel/config.php +++ b/laravel/config.php @@ -140,4 +140,15 @@ protected static function load($file) return isset(static::$items[$file]); } + /** + * Add a directory to the configuration manager's search paths. + * + * @param string $path + * @return void + */ + public static function glance($path) + { + static::$paths[] = $path; + } + } \ No newline at end of file