Completed
Push — develop ( 1b377f...60e164 )
by Mario
05:01
created

AppKernel::getRootDir()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
use Symfony\Component\Config\Loader\LoaderInterface;
4
use Symfony\Component\HttpKernel\Kernel;
5
6
/**
7
 * Class AppKernel
8
 */
9
class AppKernel extends Kernel
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function registerBundles()
15
    {
16
        $bundles = [
17
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
18
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
19
            new Symfony\Bundle\TwigBundle\TwigBundle(),
20
            new Symfony\Bundle\MonologBundle\MonologBundle(),
21
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
22
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
23
            new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
24
            new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
25
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
26
            new Dunglas\ActionBundle\DunglasActionBundle(),
27
            new ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle(),
28
            new Nelmio\CorsBundle\NelmioCorsBundle(),
29
            new Knp\DoctrineBehaviors\Bundle\DoctrineBehaviorsBundle(),
30
            new Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle(),
31
//            new Dunglas\DoctrineJsonOdm\Bundle\DunglasDoctrineJsonOdmBundle(),
32
            new Snc\RedisBundle\SncRedisBundle(),
33
            new Ds\Component\Api\Bridge\Symfony\Bundle\DsApiBundle(),
34
            new Ds\Component\Cache\Bridge\Symfony\Bundle\DsCacheBundle(),
35
            new Ds\Component\Config\Bridge\Symfony\Bundle\DsConfigBundle(),
36
            new Ds\Component\Discovery\Bridge\Symfony\Bundle\DsDiscoveryBundle(),
37
            new Ds\Component\Entity\Bridge\Symfony\Bundle\DsEntityBundle(),
38
            new Ds\Component\Health\Bridge\Symfony\Bundle\DsHealthBundle(),
39
            new Ds\Component\Locale\Bridge\Symfony\Bundle\DsLocaleBundle(),
40
            new Ds\Component\Log\Bridge\Symfony\Bundle\DsLogBundle(),
41
            new Ds\Component\Resolver\Bridge\Symfony\Bundle\DsResolverBundle(),
42
            new Ds\Component\Security\Bridge\Symfony\Bundle\DsSecurityBundle(),
43
            new Ds\Component\Session\Bridge\Symfony\Bundle\DsSessionBundle(),
44
            new Ds\Component\Statistic\Bridge\Symfony\Bundle\DsStatisticBundle(),
45
            new Ds\Component\Translation\Bridge\Symfony\Bundle\DsTranslationBundle(),
46
            new AppBundle\AppBundle(),
47
        ];
48
49
        if (in_array($this->getEnvironment(), ['prod'], true)) {
50
            $bundles[] = new Ds\Component\Exception\Bridge\Symfony\Bundle\DsExceptionBundle();
51
        }
52
53
        if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
54
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
55
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
56
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
57
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
58
            $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
59
            $bundles[] = new Ds\Component\Debug\Bridge\Symfony\Bundle\DsDebugBundle();
60
            $bundles[] = new Ds\Component\Identity\Bridge\Symfony\TestBundle\DsIdentityTestBundle();
61
        }
62
63
        return $bundles;
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69
    public function getRootDir()
70
    {
71
        return __DIR__;
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function getCacheDir()
78
    {
79
        return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
80
    }
81
82
    /**
83
     * {@inheritdoc}
84
     */
85
    public function getLogDir()
86
    {
87
        return dirname(__DIR__).'/var/logs';
88
    }
89
90
    /**
91
     * {@inheritdoc}
92
     */
93
    public function registerContainerConfiguration(LoaderInterface $loader)
94
    {
95
        $loader->load($this->getRootDir().'/config/'.$this->getEnvironment().'/config.yml');
96
    }
97
}
98