src/Kernel.php line 39

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace App;
  11. use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
  12. use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
  13. use Symfony\Component\HttpKernel\Kernel as BaseKernel;
  14. use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
  15. class Kernel extends BaseKernel
  16. {
  17.     use MicroKernelTrait;
  18.     protected function configureContainer(ContainerConfigurator $container): void
  19.     {
  20.         $container->import('../config/{packages}/*.yaml');
  21.         $container->import('../config/{packages}/'.$this->environment.'/*.yaml');
  22.         if (is_file(\dirname(__DIR__).'/config/services.yaml')) {
  23.             $container->import('../config/services.yaml');
  24.             $container->import('../config/{services}_'.$this->environment.'.yaml');
  25.         } elseif (is_file($path \dirname(__DIR__).'/config/services.php')) {
  26.             (require $path)($container->withPath($path), $this);
  27.         }
  28.     }
  29.     protected function configureRoutes(RoutingConfigurator $routes): void
  30.     {
  31.         $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');
  32.         $routes->import('../config/{routes}/*.yaml');
  33.         if (is_file(\dirname(__DIR__).'/config/routes.yaml')) {
  34.             $routes->import('../config/routes.yaml');
  35.         } elseif (is_file($path \dirname(__DIR__).'/config/routes.php')) {
  36.             (require $path)($routes->withPath($path), $this);
  37.         }
  38.         $default $_ENV["KERNEL_MODE"];
  39.         $defaultPriority $_ENV["KERNEL_MODE_PRIORITY"];
  40.         if($defaultPriority != "") {
  41.             $routes->import('../config/routes_before_'.$defaultPriority.'.yaml');
  42.         }
  43.         $routes->import('../config/routes_'.$default.'.yaml');
  44.         if($defaultPriority != "") {
  45.             $routes->import('../config/routes_after_' $defaultPriority '.yaml');
  46.         }
  47.     }
  48. }