1 | <?php |
||
11 | class AppKernel extends Kernel |
||
12 | { |
||
13 | public function registerBundles() |
||
14 | { |
||
15 | $bundles = [ |
||
16 | new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(), |
||
17 | new \Symfony\Bundle\TwigBundle\TwigBundle(), |
||
18 | new \Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(), |
||
19 | new \Symfony\Bundle\SecurityBundle\SecurityBundle(), |
||
20 | new \Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), |
||
21 | new \Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), |
||
22 | new \Oneup\FlysystemBundle\OneupFlysystemBundle(), |
||
23 | new \Sonata\BlockBundle\SonataBlockBundle(), |
||
24 | new \Sonata\CoreBundle\SonataCoreBundle(), |
||
25 | new \Sonata\AdminBundle\SonataAdminBundle(), |
||
26 | new \Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(), |
||
27 | new \Knp\Bundle\MenuBundle\KnpMenuBundle(), |
||
28 | new \MediaMonks\SonataMediaBundle\MediaMonksSonataMediaBundle(), |
||
29 | new \AppBundle\AppBundle(), |
||
30 | ]; |
||
31 | |||
32 | if (in_array($this->getEnvironment(), ['test'], true)) { |
||
33 | $bundles[] = new Liip\FunctionalTestBundle\LiipFunctionalTestBundle(); |
||
34 | $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(); |
||
35 | } |
||
36 | |||
37 | return $bundles; |
||
38 | } |
||
39 | |||
40 | public function registerContainerConfiguration(LoaderInterface $loader) |
||
41 | { |
||
42 | $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml'); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function getCacheDir() |
||
49 | { |
||
50 | return sprintf('%s/../var/cache/%s', $this->rootDir, $this->environment); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | public function getLogDir() |
||
57 | { |
||
58 | return sprintf('%s/../var/logs', $this->rootDir); |
||
59 | } |
||
60 | } |