aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/AppKernel.php
diff options
context:
space:
mode:
authorlizyn <zhiylin@outlook.com>2020-02-24 10:04:13 +0800
committerGitHub <noreply@github.com>2020-02-24 10:04:13 +0800
commitb19df31d78d881a43bcf6b3215e5fc3781e8e8aa (patch)
treed0d9861694a4b5e5fbfdbeb53c255ecd15fe9328 /app/AppKernel.php
parent4d0c632c70ea50d459c3c55ddda2e0f394dd51cb (diff)
parent04d918cae0227c06a41d27fb6533dddbf30dfe71 (diff)
downloadwallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.gz
wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.zst
wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.zip
Merge pull request #1 from wallabag/master
Keep up with the master again
Diffstat (limited to 'app/AppKernel.php')
-rw-r--r--app/AppKernel.php26
1 files changed, 22 insertions, 4 deletions
diff --git a/app/AppKernel.php b/app/AppKernel.php
index 40726f05..fcf929c6 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,9 @@ 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(),
38 new Sentry\SentryBundle\SentryBundle(),
35 39
36 // wallabag bundles 40 // wallabag bundles
37 new Wallabag\CoreBundle\WallabagCoreBundle(), 41 new Wallabag\CoreBundle\WallabagCoreBundle(),
@@ -39,25 +43,32 @@ class AppKernel extends Kernel
39 new Wallabag\UserBundle\WallabagUserBundle(), 43 new Wallabag\UserBundle\WallabagUserBundle(),
40 new Wallabag\ImportBundle\WallabagImportBundle(), 44 new Wallabag\ImportBundle\WallabagImportBundle(),
41 new Wallabag\AnnotationBundle\WallabagAnnotationBundle(), 45 new Wallabag\AnnotationBundle\WallabagAnnotationBundle(),
42 new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
43 ]; 46 ];
44 47
45 if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { 48 if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
46 $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); 49 $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
47 $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 50 $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
48 $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 51 $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
49 $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
50 $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(); 52 $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
51 $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
52 53
53 if ('test' === $this->getEnvironment()) { 54 if ('test' === $this->getEnvironment()) {
54 $bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle(); 55 $bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle();
55 } 56 }
57
58 if ('dev' === $this->getEnvironment()) {
59 $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
60 $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
61 }
56 } 62 }
57 63
58 return $bundles; 64 return $bundles;
59 } 65 }
60 66
67 public function getRootDir()
68 {
69 return __DIR__;
70 }
71
61 public function getCacheDir() 72 public function getCacheDir()
62 { 73 {
63 return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment(); 74 return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
@@ -70,7 +81,8 @@ class AppKernel extends Kernel
70 81
71 public function registerContainerConfiguration(LoaderInterface $loader) 82 public function registerContainerConfiguration(LoaderInterface $loader)
72 { 83 {
73 $loader->load($this->getProjectDir() . '/app/config/config_' . $this->getEnvironment() . '.yml'); 84 $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
85
74 $loader->load(function ($container) { 86 $loader->load(function ($container) {
75 if ($container->getParameter('use_webpack_dev_server')) { 87 if ($container->getParameter('use_webpack_dev_server')) {
76 $container->loadFromExtension('framework', [ 88 $container->loadFromExtension('framework', [
@@ -86,5 +98,11 @@ class AppKernel extends Kernel
86 ]); 98 ]);
87 } 99 }
88 }); 100 });
101
102 $loader->load(function (ContainerBuilder $container) {
103 // $container->setParameter('container.autowiring.strict_mode', true);
104 // $container->setParameter('container.dumper.inline_class_loader', true);
105 $container->addObjectResource($this);
106 });
89 } 107 }
90} 108}