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')) {
|
|
|
|
$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);
|
|
|
|
}
|
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')) {
|
|
|
|
$routes->import('../config/{routes}.yaml');
|
|
|
|
} elseif (is_file($path = \dirname(__DIR__).'/config/routes.php')) {
|
|
|
|
(require $path)($routes->withPath($path), $this);
|
|
|
|
}
|
2019-02-23 16:49:38 +01:00
|
|
|
}
|
|
|
|
}
|