tweaked route finder to recursive search directories.

This commit is contained in:
Taylor Otwell 2011-07-18 22:43:55 -05:00
parent 88276ba79e
commit 44e8867672
1 changed files with 5 additions and 3 deletions

View File

@ -67,12 +67,14 @@ private static function load()
{
$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;