]>
Commit | Line | Data |
---|---|---|
93fd4692 NL |
1 | <?php |
2 | ||
93fd4692 | 3 | use Symfony\Component\Config\Loader\LoaderInterface; |
6fc95673 | 4 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
f808b016 | 5 | use Symfony\Component\HttpKernel\Kernel; |
93fd4692 NL |
6 | |
7 | class AppKernel extends Kernel | |
8 | { | |
9 | public function registerBundles() | |
10 | { | |
73cd160b | 11 | $bundles = [ |
93fd4692 NL |
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(), | |
93fd4692 NL |
17 | new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), |
18 | new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), | |
e4788de5 | 19 | new FOS\RestBundle\FOSRestBundle(), |
a1691859 | 20 | new FOS\UserBundle\FOSUserBundle(), |
e4788de5 NL |
21 | new JMS\SerializerBundle\JMSSerializerBundle(), |
22 | new Nelmio\ApiDocBundle\NelmioApiDocBundle(), | |
dcae2fc2 | 23 | new Nelmio\CorsBundle\NelmioCorsBundle(), |
32da2a70 | 24 | new Liip\ThemeBundle\LiipThemeBundle(), |
769e19dc | 25 | new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(), |
26864574 | 26 | new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(), |
fcb1fba5 | 27 | new FOS\OAuthServerBundle\FOSOAuthServerBundle(), |
3c65dfb7 | 28 | new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), |
2db616b5 | 29 | new Scheb\TwoFactorBundle\SchebTwoFactorBundle(), |
c3510620 | 30 | new KPhoen\RulerZBundle\KPhoenRulerZBundle(), |
292c1324 | 31 | new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), |
63e40f2d | 32 | new Craue\ConfigBundle\CraueConfigBundle(), |
624a7c6d | 33 | new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(), |
3cc78f06 | 34 | new FOS\JsRoutingBundle\FOSJsRoutingBundle(), |
7aab0ecf | 35 | new BD\GuzzleSiteAuthenticatorBundle\BDGuzzleSiteAuthenticatorBundle(), |
115de64e | 36 | new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(), |
bf9ace06 | 37 | new Http\HttplugBundle\HttplugBundle(), |
955a3bde | 38 | new Sentry\SentryBundle\SentryBundle(), |
624a7c6d NL |
39 | |
40 | // wallabag bundles | |
41 | new Wallabag\CoreBundle\WallabagCoreBundle(), | |
42 | new Wallabag\ApiBundle\WallabagApiBundle(), | |
43 | new Wallabag\UserBundle\WallabagUserBundle(), | |
44 | new Wallabag\ImportBundle\WallabagImportBundle(), | |
4dc87223 | 45 | new Wallabag\AnnotationBundle\WallabagAnnotationBundle(), |
73cd160b | 46 | ]; |
93fd4692 | 47 | |
73cd160b | 48 | if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { |
93fd4692 | 49 | $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); |
93fd4692 NL |
50 | $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); |
51 | $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); | |
3b815d2d | 52 | $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(); |
7ab5eb95 | 53 | |
54 | if ('test' === $this->getEnvironment()) { | |
55 | $bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle(); | |
56 | } | |
6fc95673 JB |
57 | |
58 | if ('dev' === $this->getEnvironment()) { | |
59 | $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); | |
60 | $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle(); | |
61 | } | |
93fd4692 NL |
62 | } |
63 | ||
64 | return $bundles; | |
65 | } | |
66 | ||
6fc95673 JB |
67 | public function getRootDir() |
68 | { | |
69 | return __DIR__; | |
70 | } | |
71 | ||
73cd160b JB |
72 | public function getCacheDir() |
73 | { | |
f808b016 | 74 | return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment(); |
73cd160b JB |
75 | } |
76 | ||
77 | public function getLogDir() | |
78 | { | |
f808b016 | 79 | return dirname(__DIR__) . '/var/logs'; |
73cd160b JB |
80 | } |
81 | ||
93fd4692 NL |
82 | public function registerContainerConfiguration(LoaderInterface $loader) |
83 | { | |
6fc95673 JB |
84 | $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml'); |
85 | ||
64f81bc3 | 86 | $loader->load(function ($container) { |
f808b016 JB |
87 | if ($container->getParameter('use_webpack_dev_server')) { |
88 | $container->loadFromExtension('framework', [ | |
64f81bc3 TC |
89 | 'assets' => [ |
90 | 'base_url' => 'http://localhost:8080/', | |
91 | ], | |
92 | ]); | |
0d9c8081 | 93 | } else { |
e8694faa KD |
94 | $container->loadFromExtension('framework', [ |
95 | 'assets' => [ | |
96 | 'base_url' => $container->getParameter('domain_name'), | |
0d9c8081 | 97 | ], |
e8694faa KD |
98 | ]); |
99 | } | |
64f81bc3 | 100 | }); |
6fc95673 JB |
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 | }); | |
93fd4692 NL |
107 | } |
108 | } |