<?php/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */namespace App;use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;use Symfony\Component\HttpKernel\Kernel as BaseKernel;use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;class Kernel extends BaseKernel{ use MicroKernelTrait; protected function configureContainer(ContainerConfigurator $container): void { $kernelMode = $_ENV["KERNEL_MODE"]; $kernelApplication = $_ENV["KERNEL_APPLICATION"]; $container->import('../config/{packages}/*.yaml'); $container->import('../config/{packages}/'.$this->environment.'/*.yaml'); if (is_file(\dirname(__DIR__).'/config/services.yaml')) { $container->import('../config/services.yaml'); $container->import('../config/{services}_'.$this->environment.'.yaml'); } elseif (is_file($path = \dirname(__DIR__).'/config/services.php')) { (require $path)($container->withPath($path), $this); } if(!empty($kernelApplication)) { $container->import('../config/services_'.$kernelApplication.'.yaml'); } } protected function configureRoutes(RoutingConfigurator $routes): void { $routes->import('../config/{routes}/'.$this->environment.'/*.yaml'); $routes->import('../config/{routes}/*.yaml'); if (is_file(\dirname(__DIR__).'/config/routes.yaml')) { $routes->import('../config/routes.yaml'); } elseif (is_file($path = \dirname(__DIR__).'/config/routes.php')) { (require $path)($routes->withPath($path), $this); } $kernelMode = $_ENV["KERNEL_MODE"]; $kernelApplication = $_ENV["KERNEL_APPLICATION"]; if($kernelMode == "vitrine") { $routes->import('../config/routes_vitrine.yaml'); if(!empty($kernelApplication)) { $routes->import('../config/routes_application_'.$kernelApplication.'.yaml'); } } else { if(!empty($kernelApplication)) { $routes->import('../config/routes_application_vitrine_'.$kernelApplication.'.yaml'); } } }}