2019-10-24 13:06:51 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
2021-04-20 16:14:34 +02:00
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
2019-10-24 13:06:51 +02:00
|
|
|
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
|
2021-04-20 16:14:34 +02:00
|
|
|
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
2019-10-24 13:06:51 +02:00
|
|
|
|
|
|
|
class Kernel extends BaseKernel
|
|
|
|
{
|
|
|
|
use MicroKernelTrait;
|
|
|
|
|
2021-04-20 16:14:34 +02:00
|
|
|
protected function configureContainer(ContainerConfigurator $container): void
|
2019-10-24 13:06:51 +02:00
|
|
|
{
|
2021-04-20 16:14:34 +02:00
|
|
|
$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);
|
2019-10-24 13:06:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-20 16:14:34 +02:00
|
|
|
protected function configureRoutes(RoutingConfigurator $routes): void
|
2019-10-24 13:06:51 +02:00
|
|
|
{
|
2021-04-20 16:14:34 +02:00
|
|
|
$routes->import('../config/{routes}/'.$this->environment.'/*.yaml');
|
|
|
|
$routes->import('../config/{routes}/*.yaml');
|
2019-10-24 13:06:51 +02:00
|
|
|
|
2021-04-20 16:14:34 +02:00
|
|
|
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);
|
|
|
|
}
|
2019-10-24 13:06:51 +02:00
|
|
|
}
|
|
|
|
}
|