fix bug in route loader that caused exception to be thrown when 404 should have been shown.

This commit is contained in:
Taylor Otwell 2011-06-18 09:34:52 -05:00
parent 150fa6a3ac
commit 8f8c5f6dd4
1 changed files with 6 additions and 6 deletions

View File

@ -18,16 +18,16 @@ public static function load($uri)
return require APP_PATH.'routes'.EXT;
}
// --------------------------------------------------------------
// If the request is to the root, load the "home" routes file.
// --------------------------------------------------------------
if ($uri == '/')
{
if ( ! file_exists(APP_PATH.'routes/home'.EXT))
{
throw new \Exception("A [home] route file is required when using a route directory.");
}
// --------------------------------------------------------------
// If the request is to the root, load the "home" routes file.
// --------------------------------------------------------------
if ($uri == '/')
{
return require APP_PATH.'routes/home'.EXT;
}
// --------------------------------------------------------------
@ -39,7 +39,7 @@ public static function load($uri)
if ( ! file_exists(APP_PATH.'routes/'.$segments[0].EXT))
{
throw new \Exception("No route file defined for routes beginning with [".$segments[0]."]");
return require APP_PATH.'routes/home'.EXT;
}
return array_merge(require APP_PATH.'routes/'.$segments[0].EXT, require APP_PATH.'routes/home'.EXT);