mirror of
https://github.com/symfony/recipes.git
synced 2026-09-12 07:36:30 +03:00
fixed Kernel when routing/ dir does not exist
This commit is contained in:
@@ -59,7 +59,9 @@ class Kernel extends BaseKernel
|
||||
protected function configureRoutes(RouteCollectionBuilder $routes)
|
||||
{
|
||||
$confDir = dirname($this->getRootDir()).'/etc';
|
||||
$routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');
|
||||
if (is_dir($confDir.'/routing/')) {
|
||||
$routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');
|
||||
}
|
||||
if (is_dir($confDir.'/routing/'.$this->getEnvironment())) {
|
||||
$routes->import($confDir.'/routing/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, '/', 'glob');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user