diff --git a/system/route/finder.php b/system/route/finder.php index 3900e11b..60dce528 100644 --- a/system/route/finder.php +++ b/system/route/finder.php @@ -67,12 +67,14 @@ class Finder { { $routes = array(); - foreach (glob(APP_PATH.'routes/*') as $file) + $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(APP_PATH.'routes'), \RecursiveIteratorIterator::SELF_FIRST); + + foreach ($iterator as $file) { - if (filetype($file) == 'file') + if (filetype($file) === 'file') { $routes = array_merge(require $file, $routes); - } + } } return $routes;