diff --git a/symfony/framework-bundle/5.1/src/Kernel.php b/symfony/framework-bundle/5.1/src/Kernel.php index 58608c76..3f282188 100644 --- a/symfony/framework-bundle/5.1/src/Kernel.php +++ b/symfony/framework-bundle/5.1/src/Kernel.php @@ -15,14 +15,26 @@ class Kernel extends BaseKernel { $container->import('../config/{packages}/*.yaml'); $container->import('../config/{packages}/'.$this->environment.'/*.yaml'); - $container->import('../config/{services}.yaml'); - $container->import('../config/{services}_'.$this->environment.'.yaml'); + + if (file_exists(\dirname(__DIR__).'/config/services.yaml')) { + $container->import('../config/{services}.yaml'); + $container->import('../config/{services}_'.$this->environment.'.yaml'); + } else { + $path = \dirname(__DIR__).'/config/services.php'; + (require $path)($container->withPath($path), $this); + } } protected function configureRoutes(RoutingConfigurator $routes): void { $routes->import('../config/{routes}/'.$this->environment.'/*.yaml'); $routes->import('../config/{routes}/*.yaml'); - $routes->import('../config/{routes}.yaml'); + + if (file_exists(\dirname(__DIR__).'/config/routes.yaml')) { + $routes->import('../config/{routes}.yaml'); + } else { + $path = \dirname(__DIR__).'/config/routes.php'; + (require $path)($routes->withPath($path), $this); + } } }