AppKernel.php 2.31 KB
Newer Older
Fabien Potencier's avatar
Fabien Potencier committed
1 2 3 4 5 6 7 8 9 10 11
<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
12
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
Fabien Potencier's avatar
Fabien Potencier committed
13
            new Symfony\Bundle\TwigBundle\TwigBundle(),
14
            new Symfony\Bundle\MonologBundle\MonologBundle(),
Fabien Potencier's avatar
Fabien Potencier committed
15
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
16
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
17
            new Symfony\Bundle\DebugBundle\DebugBundle(),
Fabien Potencier's avatar
Fabien Potencier committed
18
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
19
            new Chill\MainBundle\ChillMainBundle(),
Marc Ducobu's avatar
Marc Ducobu committed
20
            new Chill\CustomFieldsBundle\ChillCustomFieldsBundle(),
21
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
22
            new Chill\PersonBundle\ChillPersonBundle(),
Marc Ducobu's avatar
Marc Ducobu committed
23
            new Chill\ReportBundle\ChillReportBundle(),
24
            new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
Julien Fastré's avatar
Julien Fastré committed
25
            new Chill\ActivityBundle\ChillActivityBundle(),
26 27
            new Chill\TaskBundle\ChillTaskBundle(),
            new Knp\Bundle\MenuBundle\KnpMenuBundle(),
28 29 30
            new Chill\DocStoreBundle\ChillDocStoreBundle(),
            new ChampsLibres\AsyncUploaderBundle\ChampsLibresAsyncUploaderBundle(),
            new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle()
Fabien Potencier's avatar
Fabien Potencier committed
31 32 33 34
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
35
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
36
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();            
37
            $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
Fabien Potencier's avatar
Fabien Potencier committed
38 39 40 41 42 43 44
        }

        return $bundles;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
45
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');        
Fabien Potencier's avatar
Fabien Potencier committed
46
    }
47 48 49 50 51 52 53 54 55 56
    
    public function getCacheDir()
    {
        return \sys_get_temp_dir().'/app/cache/'.$this->getEnvironment();
    }
    
    public function getLogDir()
    {
        return \sys_get_temp_dir().'/app/logs';
    }
Fabien Potencier's avatar
Fabien Potencier committed
57
}