diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2018-10-24 21:02:35 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2018-10-24 21:47:51 +0200 |
commit | b502d6ad0964267b49f91eafb3bed8a4693aba0f (patch) | |
tree | d362c7b4d064c93846664297a8b316090c89e079 /app/AppKernel.php | |
parent | a02924ea2618549bacf948188c06092afcd6a8d1 (diff) | |
download | wallabag-b502d6ad0964267b49f91eafb3bed8a4693aba0f.tar.gz wallabag-b502d6ad0964267b49f91eafb3bed8a4693aba0f.tar.zst wallabag-b502d6ad0964267b49f91eafb3bed8a4693aba0f.zip |
Cleanup
Diffstat (limited to 'app/AppKernel.php')
-rw-r--r-- | app/AppKernel.php | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/app/AppKernel.php b/app/AppKernel.php index 546794de..7d19e9ab 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php | |||
@@ -1,6 +1,7 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | use Symfony\Component\Config\Loader\LoaderInterface; | 3 | use Symfony\Component\Config\Loader\LoaderInterface; |
4 | use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
4 | use Symfony\Component\HttpKernel\Kernel; | 5 | use Symfony\Component\HttpKernel\Kernel; |
5 | 6 | ||
6 | class AppKernel extends Kernel | 7 | class AppKernel extends Kernel |
@@ -46,18 +47,26 @@ class AppKernel extends Kernel | |||
46 | $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); | 47 | $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); |
47 | $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); | 48 | $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); |
48 | $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); | 49 | $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); |
49 | $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); | ||
50 | $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(); | 50 | $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(); |
51 | $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle(); | ||
52 | 51 | ||
53 | if ('test' === $this->getEnvironment()) { | 52 | if ('test' === $this->getEnvironment()) { |
54 | $bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle(); | 53 | $bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle(); |
55 | } | 54 | } |
55 | |||
56 | if ('dev' === $this->getEnvironment()) { | ||
57 | $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); | ||
58 | $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle(); | ||
59 | } | ||
56 | } | 60 | } |
57 | 61 | ||
58 | return $bundles; | 62 | return $bundles; |
59 | } | 63 | } |
60 | 64 | ||
65 | public function getRootDir() | ||
66 | { | ||
67 | return __DIR__; | ||
68 | } | ||
69 | |||
61 | public function getCacheDir() | 70 | public function getCacheDir() |
62 | { | 71 | { |
63 | return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment(); | 72 | return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment(); |
@@ -70,7 +79,8 @@ class AppKernel extends Kernel | |||
70 | 79 | ||
71 | public function registerContainerConfiguration(LoaderInterface $loader) | 80 | public function registerContainerConfiguration(LoaderInterface $loader) |
72 | { | 81 | { |
73 | $loader->load($this->getProjectDir() . '/app/config/config_' . $this->getEnvironment() . '.yml'); | 82 | $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml'); |
83 | |||
74 | $loader->load(function ($container) { | 84 | $loader->load(function ($container) { |
75 | if ($container->getParameter('use_webpack_dev_server')) { | 85 | if ($container->getParameter('use_webpack_dev_server')) { |
76 | $container->loadFromExtension('framework', [ | 86 | $container->loadFromExtension('framework', [ |
@@ -86,5 +96,11 @@ class AppKernel extends Kernel | |||
86 | ]); | 96 | ]); |
87 | } | 97 | } |
88 | }); | 98 | }); |
99 | |||
100 | $loader->load(function (ContainerBuilder $container) { | ||
101 | // $container->setParameter('container.autowiring.strict_mode', true); | ||
102 | // $container->setParameter('container.dumper.inline_class_loader', true); | ||
103 | $container->addObjectResource($this); | ||
104 | }); | ||
89 | } | 105 | } |
90 | } | 106 | } |