diff options
| author | marwolaethblack <a.unal677@gmail.com> | 2017-11-22 12:37:48 +0100 | 
|---|---|---|
| committer | marwolaethblack <a.unal677@gmail.com> | 2017-11-22 12:37:48 +0100 | 
| commit | 4312b353dbb4b448d551975b63db9c95b3eef4f5 (patch) | |
| tree | 90c991bc462526725593f82e56b288cfce2c7e03 /app/AppKernel.php | |
initial commit
Diffstat (limited to 'app/AppKernel.php')
| -rw-r--r-- | app/AppKernel.php | 54 | 
1 files changed, 54 insertions, 0 deletions
| diff --git a/app/AppKernel.php b/app/AppKernel.php new file mode 100644 index 0000000..ef068e0 --- /dev/null +++ b/app/AppKernel.php @@ -0,0 +1,54 @@ +<?php + +use Symfony\Component\HttpKernel\Kernel; +use Symfony\Component\Config\Loader\LoaderInterface; + +class AppKernel extends Kernel +{ +    public function registerBundles() +    { +        $bundles = [ +            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), +            new Symfony\Bundle\SecurityBundle\SecurityBundle(), +            new Symfony\Bundle\TwigBundle\TwigBundle(), +            new Symfony\Bundle\MonologBundle\MonologBundle(), +            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), +            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), +            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), +            new AppBundle\AppBundle(), +        ]; + +        if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { +            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); +            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); +            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); + +            if ('dev' === $this->getEnvironment()) { +                $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); +                $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle(); +            } +        } + +        return $bundles; +    } + +    public function getRootDir() +    { +        return __DIR__; +    } + +    public function getCacheDir() +    { +        return dirname(__DIR__).'/var/cache/'.$this->getEnvironment(); +    } + +    public function getLogDir() +    { +        return dirname(__DIR__).'/var/logs'; +    } + +    public function registerContainerConfiguration(LoaderInterface $loader) +    { +        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml'); +    } +} |