2019-02-23 16:49:38 +01:00
|
|
|
<?php
|
2020-02-01 16:17:20 +01:00
|
|
|
|
2019-02-23 16:49:38 +01:00
|
|
|
namespace App;
|
|
|
|
|
|
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
2020-05-31 19:56:50 +02:00
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
2019-02-23 16:49:38 +01:00
|
|
|
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
|
2020-05-31 19:56:50 +02:00
|
|
|
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
2019-02-23 16:49:38 +01:00
|
|
|
|
|
|
|
|
class Kernel extends BaseKernel
|
|
|
|
|
{
|
|
|
|
|
use MicroKernelTrait;
|
|
|
|
|
|
2020-05-31 19:56:50 +02:00
|
|
|
protected function configureContainer(ContainerConfigurator $container): void
|
2020-01-07 19:06:08 +01:00
|
|
|
{
|
2020-05-31 19:56:50 +02:00
|
|
|
$container->import('../config/{packages}/*.yaml');
|
|
|
|
|
$container->import('../config/{packages}/'.$this->environment.'/*.yaml');
|
2020-05-31 19:58:57 +02:00
|
|
|
|
2020-07-04 23:44:15 +02:00
|
|
|
//Add parameters.yml
|
2020-05-31 19:58:57 +02:00
|
|
|
$container->import('../config/parameters.yaml');
|
2020-07-04 23:44:15 +02:00
|
|
|
|
|
|
|
|
if (is_file(\dirname(__DIR__).'/config/services.yaml')) {
|
2021-10-02 20:56:49 +02:00
|
|
|
$container->import('../config/services.yaml');
|
2020-07-04 23:44:15 +02:00
|
|
|
$container->import('../config/{services}_'.$this->environment.'.yaml');
|
2021-10-02 20:56:49 +02:00
|
|
|
} else {
|
|
|
|
|
$container->import('../config/{services}.php');
|
2020-07-04 23:44:15 +02:00
|
|
|
}
|
2020-01-07 19:06:08 +01:00
|
|
|
}
|
|
|
|
|
|
2020-05-31 19:56:50 +02:00
|
|
|
protected function configureRoutes(RoutingConfigurator $routes): void
|
2019-02-23 16:49:38 +01:00
|
|
|
{
|
2020-05-31 19:56:50 +02:00
|
|
|
$routes->import('../config/{routes}/'.$this->environment.'/*.yaml');
|
|
|
|
|
$routes->import('../config/{routes}/*.yaml');
|
2020-07-04 23:44:15 +02:00
|
|
|
|
|
|
|
|
if (is_file(\dirname(__DIR__).'/config/routes.yaml')) {
|
2021-10-02 20:56:49 +02:00
|
|
|
$routes->import('../config/routes.yaml');
|
|
|
|
|
} else {
|
|
|
|
|
$routes->import('../config/{routes}.php');
|
2020-07-04 23:44:15 +02:00
|
|
|
}
|
2019-02-23 16:49:38 +01:00
|
|
|
}
|
|
|
|
|
}
|