1 | <?php |
||
14 | class Kernel extends BaseKernel |
||
15 | { |
||
16 | use MicroKernelTrait; |
||
17 | |||
18 | const CONFIG_EXTS = '.{php,xml,yaml,yml}'; |
||
19 | |||
20 | public function getCacheDir() |
||
24 | |||
25 | public function getLogDir() |
||
29 | |||
30 | public function registerBundles() |
||
39 | |||
40 | protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader) |
||
41 | { |
||
42 | $container->setParameter('container.autowiring.strict_mode', true); |
||
43 | $container->setParameter('container.dumper.inline_class_loader', true); |
||
44 | $confDir = $this->getProjectDir().'/config'; |
||
45 | $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob'); |
||
46 | if (is_dir($confDir.'/packages/'.$this->environment)) { |
||
47 | $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob'); |
||
48 | } |
||
49 | $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob'); |
||
50 | $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob'); |
||
51 | } |
||
52 | |||
53 | protected function configureRoutes(RouteCollectionBuilder $routes) |
||
54 | { |
||
55 | $confDir = $this->getProjectDir().'/config'; |
||
56 | if (is_dir($confDir.'/routes/')) { |
||
57 | $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob'); |
||
58 | } |
||
59 | if (is_dir($confDir.'/routes/'.$this->environment)) { |
||
60 | $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob'); |
||
61 | } |
||
62 | $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob'); |
||
63 | } |
||
64 | } |
||
65 |