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