1 | <?php |
||
12 | class Kernel extends BaseKernel |
||
13 | { |
||
14 | use MicroKernelTrait; |
||
15 | |||
16 | private const CONFIG_EXTS = '.{php,xml,yaml,yml}'; |
||
17 | |||
18 | 4 | public function registerBundles(): iterable |
|
27 | |||
28 | 4 | public function getProjectDir(): string |
|
32 | |||
33 | 1 | protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void |
|
34 | { |
||
35 | 1 | $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php')); |
|
36 | 1 | $container->setParameter('container.dumper.inline_class_loader', true); |
|
37 | 1 | $confDir = $this->getProjectDir().'/config'; |
|
38 | |||
39 | 1 | $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob'); |
|
40 | 1 | $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob'); |
|
41 | 1 | $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob'); |
|
42 | 1 | $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob'); |
|
43 | 1 | } |
|
44 | |||
45 | 1 | protected function configureRoutes(RouteCollectionBuilder $routes): void |
|
46 | { |
||
47 | 1 | $confDir = $this->getProjectDir().'/config'; |
|
48 | |||
49 | 1 | $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob'); |
|
50 | 1 | $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob'); |
|
51 | 1 | $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob'); |
|
52 | 1 | } |
|
53 | } |
||
54 |