Completed
Push — dev ( a1297d...02942d )
by Arnaud
03:36
created

AppKernel::getLogDir()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 10
rs 9.4285
cc 2
eloc 5
nc 2
nop 0
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
        return array(
11
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
12
            new Symfony\Bundle\TwigBundle\TwigBundle(),
13
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
14
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
15
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
16
            new Symfony\Bundle\MonologBundle\MonologBundle(),
17
            new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(),
18
            new LAG\AdminBundle\LAGAdminBundle(),
19
            new Test\TestBundle\TestTestBundle(),
20
        );
21
    }
22
23
    public function registerContainerConfiguration(LoaderInterface $loader)
24
    {
25
        $loader->load(__DIR__.'/config/config_test.yml');
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function getCacheDir()
32
    {
33
        $cacheDir = sys_get_temp_dir().'/phpunit/cache';
34
35
        if (!is_dir($cacheDir)) {
36
            mkdir($cacheDir, 0777, true);
37
        }
38
39
        return $cacheDir;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getLogDir()
46
    {
47
        $logDir = sys_get_temp_dir().'/phpunit/logs';
48
49
        if (!is_dir($logDir)) {
50
            mkdir($logDir, 0777, true);
51
        }
52
53
        return $logDir;
54
    }
55
}
56