aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/AppKernel.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/AppKernel.php')
-rw-r--r--app/AppKernel.php25
1 files changed, 21 insertions, 4 deletions
diff --git a/app/AppKernel.php b/app/AppKernel.php
index 40726f05..4a54da29 100644
--- a/app/AppKernel.php
+++ b/app/AppKernel.php
@@ -1,6 +1,7 @@
1<?php 1<?php
2 2
3use Symfony\Component\Config\Loader\LoaderInterface; 3use Symfony\Component\Config\Loader\LoaderInterface;
4use Symfony\Component\DependencyInjection\ContainerBuilder;
4use Symfony\Component\HttpKernel\Kernel; 5use Symfony\Component\HttpKernel\Kernel;
5 6
6class AppKernel extends Kernel 7class AppKernel extends Kernel
@@ -32,6 +33,8 @@ class AppKernel extends Kernel
32 new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(), 33 new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
33 new FOS\JsRoutingBundle\FOSJsRoutingBundle(), 34 new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
34 new BD\GuzzleSiteAuthenticatorBundle\BDGuzzleSiteAuthenticatorBundle(), 35 new BD\GuzzleSiteAuthenticatorBundle\BDGuzzleSiteAuthenticatorBundle(),
36 new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
37 new Http\HttplugBundle\HttplugBundle(),
35 38
36 // wallabag bundles 39 // wallabag bundles
37 new Wallabag\CoreBundle\WallabagCoreBundle(), 40 new Wallabag\CoreBundle\WallabagCoreBundle(),
@@ -39,25 +42,32 @@ class AppKernel extends Kernel
39 new Wallabag\UserBundle\WallabagUserBundle(), 42 new Wallabag\UserBundle\WallabagUserBundle(),
40 new Wallabag\ImportBundle\WallabagImportBundle(), 43 new Wallabag\ImportBundle\WallabagImportBundle(),
41 new Wallabag\AnnotationBundle\WallabagAnnotationBundle(), 44 new Wallabag\AnnotationBundle\WallabagAnnotationBundle(),
42 new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
43 ]; 45 ];
44 46
45 if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { 47 if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
46 $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); 48 $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
47 $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 49 $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
48 $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 50 $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
49 $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
50 $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(); 51 $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
51 $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
52 52
53 if ('test' === $this->getEnvironment()) { 53 if ('test' === $this->getEnvironment()) {
54 $bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle(); 54 $bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle();
55 } 55 }
56
57 if ('dev' === $this->getEnvironment()) {
58 $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
59 $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
60 }
56 } 61 }
57 62
58 return $bundles; 63 return $bundles;
59 } 64 }
60 65
66 public function getRootDir()
67 {
68 return __DIR__;
69 }
70
61 public function getCacheDir() 71 public function getCacheDir()
62 { 72 {
63 return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment(); 73 return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
@@ -70,7 +80,8 @@ class AppKernel extends Kernel
70 80
71 public function registerContainerConfiguration(LoaderInterface $loader) 81 public function registerContainerConfiguration(LoaderInterface $loader)
72 { 82 {
73 $loader->load($this->getProjectDir() . '/app/config/config_' . $this->getEnvironment() . '.yml'); 83 $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
84
74 $loader->load(function ($container) { 85 $loader->load(function ($container) {
75 if ($container->getParameter('use_webpack_dev_server')) { 86 if ($container->getParameter('use_webpack_dev_server')) {
76 $container->loadFromExtension('framework', [ 87 $container->loadFromExtension('framework', [
@@ -86,5 +97,11 @@ class AppKernel extends Kernel
86 ]); 97 ]);
87 } 98 }
88 }); 99 });
100
101 $loader->load(function (ContainerBuilder $container) {
102 // $container->setParameter('container.autowiring.strict_mode', true);
103 // $container->setParameter('container.dumper.inline_class_loader', true);
104 $container->addObjectResource($this);
105 });
89 } 106 }
90} 107}