]> git.immae.eu Git - github/wallabag/wallabag.git/blob - app/AppKernel.php
Merge pull request #4026 from wallabag/3760-ignorelist-db
[github/wallabag/wallabag.git] / app / AppKernel.php
1 <?php
2
3 use Symfony\Component\Config\Loader\LoaderInterface;
4 use Symfony\Component\DependencyInjection\ContainerBuilder;
5 use Symfony\Component\HttpKernel\Kernel;
6
7 class AppKernel extends Kernel
8 {
9 public function registerBundles()
10 {
11 $bundles = [
12 new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
13 new Symfony\Bundle\SecurityBundle\SecurityBundle(),
14 new Symfony\Bundle\TwigBundle\TwigBundle(),
15 new Symfony\Bundle\MonologBundle\MonologBundle(),
16 new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
17 new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
18 new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
19 new FOS\RestBundle\FOSRestBundle(),
20 new FOS\UserBundle\FOSUserBundle(),
21 new JMS\SerializerBundle\JMSSerializerBundle(),
22 new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
23 new Nelmio\CorsBundle\NelmioCorsBundle(),
24 new Liip\ThemeBundle\LiipThemeBundle(),
25 new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),
26 new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
27 new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
28 new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
29 new Scheb\TwoFactorBundle\SchebTwoFactorBundle(),
30 new KPhoen\RulerZBundle\KPhoenRulerZBundle(),
31 new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
32 new Craue\ConfigBundle\CraueConfigBundle(),
33 new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
34 new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
35 new BD\GuzzleSiteAuthenticatorBundle\BDGuzzleSiteAuthenticatorBundle(),
36 new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
37 new Http\HttplugBundle\HttplugBundle(),
38 new Sentry\SentryBundle\SentryBundle(),
39
40 // wallabag bundles
41 new Wallabag\CoreBundle\WallabagCoreBundle(),
42 new Wallabag\ApiBundle\WallabagApiBundle(),
43 new Wallabag\UserBundle\WallabagUserBundle(),
44 new Wallabag\ImportBundle\WallabagImportBundle(),
45 new Wallabag\AnnotationBundle\WallabagAnnotationBundle(),
46 ];
47
48 if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
49 $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
50 $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
51 $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
52 $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
53
54 if ('test' === $this->getEnvironment()) {
55 $bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle();
56 }
57
58 if ('dev' === $this->getEnvironment()) {
59 $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
60 $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
61 }
62 }
63
64 return $bundles;
65 }
66
67 public function getRootDir()
68 {
69 return __DIR__;
70 }
71
72 public function getCacheDir()
73 {
74 return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
75 }
76
77 public function getLogDir()
78 {
79 return dirname(__DIR__) . '/var/logs';
80 }
81
82 public function registerContainerConfiguration(LoaderInterface $loader)
83 {
84 $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
85
86 $loader->load(function ($container) {
87 if ($container->getParameter('use_webpack_dev_server')) {
88 $container->loadFromExtension('framework', [
89 'assets' => [
90 'base_url' => 'http://localhost:8080/',
91 ],
92 ]);
93 } else {
94 $container->loadFromExtension('framework', [
95 'assets' => [
96 'base_url' => $container->getParameter('domain_name'),
97 ],
98 ]);
99 }
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 });
107 }
108 }