tweaked route finder to recursive search directories.
This commit is contained in:
parent
88276ba79e
commit
44e8867672
|
@ -67,12 +67,14 @@ private static function load()
|
||||||
{
|
{
|
||||||
$routes = array();
|
$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);
|
$routes = array_merge(require $file, $routes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $routes;
|
return $routes;
|
||||||
|
|
Loading…
Reference in New Issue