mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-02-23 19:24:03 +01:00
18 lines
456 B
PHP
18 lines
456 B
PHP
<?php
|
|
|
|
routesInDirectory();
|
|
|
|
function routesInDirectory($app = '') {
|
|
$routeDir = app_path('routes/' . $app . ($app !== '' ? '/' : NULL));
|
|
$iterator = new RecursiveDirectoryIterator($routeDir);
|
|
$iterator->setFlags(RecursiveDirectoryIterator::SKIP_DOTS);
|
|
|
|
foreach ($iterator as $route) {
|
|
$isDotFile = strpos($route->getFilename(), '.') === 0;
|
|
|
|
if (!$isDotFile && !$route->isDir()) {
|
|
require $routeDir . $route->getFilename();
|
|
}
|
|
}
|
|
}
|