Commit 86fde936 authored by Taylor Otwell's avatar Taylor Otwell

refactor the route loader.

parent 366f8dad
...@@ -86,7 +86,10 @@ class Loader { ...@@ -86,7 +86,10 @@ class Loader {
foreach ($paths as $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')) if (is_dir($path.'routes'))
{ {
...@@ -98,7 +101,10 @@ class Loader { ...@@ -98,7 +101,10 @@ class Loader {
foreach ($recursiveIterator as $file) 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);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment