Completed
Push — develop ( 0d8456...0284fe )
by Michiel
19s queued 10s
created

AppKernel::getCacheDir()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Copyright 2015 SURFnet B.V.
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
use Symfony\Component\Config\Loader\LoaderInterface;
20
use Symfony\Component\HttpKernel\Kernel;
21
22
class AppKernel extends Kernel
23
{
24
    public function registerBundles()
25
    {
26
        $bundles = [
27
            // Framework
28
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
29
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
30
            new Symfony\Bundle\TwigBundle\TwigBundle(),
31
            new Symfony\Bundle\MonologBundle\MonologBundle(),
32
33
            // Dependencies
34
            new JMS\TranslationBundle\JMSTranslationBundle(),
35
            new Nelmio\SecurityBundle\NelmioSecurityBundle(),
36
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
37
            new Surfnet\SamlBundle\SurfnetSamlBundle(),
38
            new OpenConext\MonitorBundle\OpenConextMonitorBundle(),
39
40
            // Project
41
            new OpenConext\ProfileBundle\OpenConextProfileBundle(),
42
            new OpenConext\EngineBlockApiClientBundle\OpenConextEngineBlockApiClientBundle(),
43
            new OpenConext\UserLifecycleApiClientBundle\OpenConextUserLifecycleApiClientBundle(),
44
            new OpenConext\AttributeAggregationApiClientBundle\OpenConextAttributeAggregationApiClientBundle(),
45
        ];
46
47
        if (in_array($this->getEnvironment(), ['dev', 'test'])) {
48
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
49
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
50
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
51
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
52
        }
53
54
        return $bundles;
55
    }
56
57
    public function getRootDir()
58
    {
59
        return __DIR__;
60
    }
61
62
    public function getCacheDir()
63
    {
64
        return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
65
    }
66
67
    public function getLogDir()
68
    {
69
        return dirname(__DIR__).'/var/logs';
70
    }
71
72
    public function registerContainerConfiguration(LoaderInterface $loader)
73
    {
74
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
75
    }
76
}
77