refactor the route loader.
This commit is contained in:
parent
366f8dad39
commit
86fde936ac
|
@ -86,7 +86,10 @@ 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'))
|
||||
{
|
||||
|
@ -98,7 +101,10 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue