Completed
Push — master ( 477f5d...23fcb0 )
by San
06:01
created

AppKernel::getRootDir()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
use \Symfony\Component\HttpKernel\Kernel;
4
use \Symfony\Component\Config\Loader\LoaderInterface;
5
6
class AppKernel extends Kernel
7
{
8
    public function registerBundles()
9
    {
10
        $bundles = [
11
            new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
12
            new \Symfony\Bundle\AsseticBundle\AsseticBundle(),
13
            new \Symfony\Bundle\MonologBundle\MonologBundle(),
14
            new \Symfony\Bundle\TwigBundle\TwigBundle(),
15
            new \PommProject\PommBundle\PommBundle(),
16
            new \AppBundle\AppBundle(),
17
        ];
18
19
        if (in_array($this->getEnvironment(), ['dev', 'test'])) {
20
            $bundles[] = new \Symfony\Bundle\DebugBundle\DebugBundle();
21
            $bundles[] = new \Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
22
            $bundles[] = new \Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
23
        }
24
25
        return $bundles;
26
    }
27
28
    public function getRootDir()
29
    {
30
        return __DIR__;
31
    }
32
33
    public function getCacheDir()
34
    {
35
        return __DIR__ . '/../var/cache/' . $this->getEnvironment();
36
    }
37
38
    public function getLogDir()
39
    {
40
        return __DIR__ . '/../var/logs';
41
    }
42
43
    public function registerContainerConfiguration(LoaderInterface $loader)
44
    {
45
        $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
46
    }
47
}
48