You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 3 години
1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App;
  3. use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
  4. use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
  5. use Symfony\Component\HttpKernel\Kernel as BaseKernel;
  6. use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
  7. class Kernel extends BaseKernel
  8. {
  9. use MicroKernelTrait;
  10. protected function configureContainer(ContainerConfigurator $container): void
  11. {
  12. $container->import('../config/{packages}/*.yaml');
  13. $container->import('../config/{packages}/'.$this->environment.'/*.yaml');
  14. if (is_file(\dirname(__DIR__).'/config/services.yaml')) {
  15. $container->import('../config/services.yaml');
  16. $container->import('../config/{services}_'.$this->environment.'.yaml');
  17. } elseif (is_file($path = \dirname(__DIR__).'/config/services.php')) {
  18. (require $path)($container->withPath($path), $this);
  19. }
  20. }
  21. protected function configureRoutes(RoutingConfigurator $routes): void
  22. {
  23. $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');
  24. $routes->import('../config/{routes}/*.yaml');
  25. if (is_file(\dirname(__DIR__).'/config/routes.yaml')) {
  26. $routes->import('../config/routes.yaml');
  27. } elseif (is_file($path = \dirname(__DIR__).'/config/routes.php')) {
  28. (require $path)($routes->withPath($path), $this);
  29. }
  30. }
  31. }