From b5e0eb022c6fae028332306980c2f3c143167e0d Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 7 Jul 2011 09:49:31 -0700 Subject: [PATCH] Refactoring Router. --- system/router.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/system/router.php b/system/router.php index f2de59fe..ace47dc3 100644 --- a/system/router.php +++ b/system/router.php @@ -23,7 +23,7 @@ class Router { if (is_null(static::$routes)) { - static::$routes = static::load($uri); + static::$routes = ( ! is_dir(APP_PATH.'routes')) ? require APP_PATH.'routes'.EXT : static::load($uri); } // Is there an exact match for the request? @@ -65,11 +65,6 @@ class Router { */ public static function load($uri) { - if ( ! is_dir(APP_PATH.'routes')) - { - return require APP_PATH.'routes'.EXT; - } - if ( ! file_exists(APP_PATH.'routes/home'.EXT)) { throw new \Exception("A [home] route file is required when using a route directory.");