1 | <?php |
||
6 | class AppKernel extends Kernel |
||
7 | { |
||
8 | |||
9 | public function registerBundles() |
||
10 | { |
||
11 | $bundles = [ |
||
12 | new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), |
||
13 | new Symfony\Bundle\WebServerBundle\WebServerBundle(), |
||
14 | new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), |
||
15 | new Symfony\Bundle\SecurityBundle\SecurityBundle(), |
||
16 | new Symfony\Bundle\TwigBundle\TwigBundle(), |
||
17 | new Symfony\Bundle\MonologBundle\MonologBundle(), |
||
18 | new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), |
||
19 | new Symfony\Bundle\AsseticBundle\AsseticBundle(), |
||
20 | new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), |
||
21 | new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), |
||
22 | new Snc\RedisBundle\SncRedisBundle(), |
||
23 | new FOS\RestBundle\FOSRestBundle(), |
||
24 | new JMS\SerializerBundle\JMSSerializerBundle(), |
||
25 | new Nelmio\CorsBundle\NelmioCorsBundle(), |
||
26 | new AppBundle\AppBundle(), |
||
27 | ]; |
||
28 | |||
29 | if (in_array($this->getEnvironment(), [ 'dev', 'test' ], true)) { |
||
30 | $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); |
||
31 | $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); |
||
32 | $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); |
||
33 | $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); |
||
34 | } |
||
35 | |||
36 | return $bundles; |
||
37 | } |
||
38 | |||
39 | public function getRootDir() |
||
40 | { |
||
41 | return __DIR__; |
||
42 | } |
||
43 | |||
44 | public function getCacheDir() |
||
45 | { |
||
46 | return dirname(__DIR__).'/var/cache/'.$this->getEnvironment().'/'; |
||
47 | } |
||
48 | |||
49 | public function getLogDir() |
||
50 | { |
||
51 | return dirname(__DIR__).'/var/logs'; |
||
52 | } |
||
53 | |||
54 | public function registerContainerConfiguration(LoaderInterface $loader) |
||
55 | { |
||
56 | $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml'); |
||
57 | } |
||
58 | } |
||
59 |