Browse Source

tweaked route finder to recursive search directories.

Taylor Otwell 13 years ago
parent
commit
44e8867672
1 changed files with 5 additions and 3 deletions
  1. 5 3
      system/route/finder.php

+ 5 - 3
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;