From 07ca09e824b1e69e051679a01b29de6f43a42d4a Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 5 Aug 2011 09:38:15 -0500 Subject: [PATCH] Add ACTIVE_MODULE constant. --- system/laravel.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/system/laravel.php b/system/laravel.php index 608e99c0..42e2307c 100644 --- a/system/laravel.php +++ b/system/laravel.php @@ -131,15 +131,23 @@ // -------------------------------------------------------------- if (is_null($response)) { - $path = (in_array($module = Request::segment(1), $modules)) ? MODULE_PATH.$module.'/' : APP_PATH; - - if ($path !== APP_PATH) + if (in_array($module = Request::segment(1), $modules)) { + define('ACTIVE_MODULE', $module); + + $path = MODULE_PATH.$module.'/'; + if (file_exists($filters = $path.'filters'.EXT)) { Routing\Filter::register(require $filters); } } + else + { + define('ACTIVE_MODULE', 'application'); + + $path = APP_PATH; + } $route = Routing\Router::make(Request::method(), Request::uri(), new Routing\Loader($path))->route();