Refactor the route loader.

This commit is contained in:
Taylor Otwell 2011-08-08 10:28:42 -05:00
parent b25edfaf9b
commit 115bde0b23
1 changed files with 2 additions and 8 deletions

View File

@ -86,10 +86,7 @@ public static function all($reload = false, $path = APP_PATH)
foreach ($paths as $path)
{
if (file_exists($path.'routes'.EXT))
{
$routes = array_merge($routes, require $path.'routes'.EXT);
}
if (file_exists($path.'routes'.EXT)) $routes = array_merge($routes, require $path.'routes'.EXT);
if (is_dir($path.'routes'))
{
@ -101,10 +98,7 @@ public static function all($reload = false, $path = APP_PATH)
foreach ($recursiveIterator as $file)
{
if (filetype($file) === 'file' and strpos($file, EXT) !== false)
{
$routes = array_merge($routes, require $file);
}
if (filetype($file) === 'file' and strpos($file, EXT) !== false) $routes = array_merge($routes, require $file);
}
}
}