1 | <?php |
||
15 | class Kernel extends BaseKernel |
||
16 | { |
||
17 | use MicroKernelTrait; |
||
18 | |||
19 | private const CONFIG_EXTS = '.{php,xml,yaml,yml}'; |
||
20 | |||
21 | public function registerBundles(): iterable |
||
30 | |||
31 | public function getProjectDir(): string |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | protected function prepareContainer(ContainerBuilder $container) |
||
44 | |||
45 | protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void |
||
46 | { |
||
47 | $container->addResource(new FileResource($this->getProjectDir() . '/config/bundles.php')); |
||
48 | $container->setParameter('container.dumper.inline_class_loader', PHP_VERSION_ID < 70400 || $this->debug); |
||
49 | $container->setParameter('container.dumper.inline_factories', true); |
||
50 | $confDir = $this->getProjectDir() . '/config'; |
||
51 | |||
52 | $loader->load($confDir . '/{packages}/*' . self::CONFIG_EXTS, 'glob'); |
||
53 | $loader->load($confDir . '/{packages}/' . $this->environment . '/*' . self::CONFIG_EXTS, 'glob'); |
||
54 | $loader->load($confDir . '/{services}' . self::CONFIG_EXTS, 'glob'); |
||
55 | $loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob'); |
||
56 | |||
57 | $loader->load($this->getProjectDir() . '/config.dist.yaml'); |
||
58 | $localGitkiAppConfigFile = $this->getProjectDir() . '/config.yaml'; |
||
59 | if (file_exists($localGitkiAppConfigFile)) { |
||
60 | $loader->load($localGitkiAppConfigFile); |
||
61 | } |
||
62 | } |
||
63 | |||
64 | protected function configureRoutes(RouteCollectionBuilder $routes): void |
||
65 | { |
||
66 | $confDir = $this->getProjectDir() . '/config'; |
||
67 | |||
68 | $routes->import($confDir . '/{routes}/' . $this->environment . '/*' . self::CONFIG_EXTS, '/', 'glob'); |
||
69 | $routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, '/', 'glob'); |
||
70 | $routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob'); |
||
71 | } |
||
72 | } |
||
73 |