1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the OrbitaleCmsBundle package. |
5
|
|
|
* |
6
|
|
|
* (c) Alexandre Rock Ancelet <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
use Symfony\Component\HttpKernel\Kernel; |
13
|
|
|
use Symfony\Component\Config\Loader\LoaderInterface; |
14
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
15
|
|
|
|
16
|
|
|
class AppKernel extends Kernel |
17
|
|
|
{ |
18
|
|
|
public function registerBundles() |
19
|
|
|
{ |
20
|
|
|
return array( |
21
|
|
|
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), |
22
|
|
|
new Symfony\Bundle\SecurityBundle\SecurityBundle(), |
23
|
|
|
new Symfony\Bundle\TwigBundle\TwigBundle(), |
24
|
|
|
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), |
25
|
|
|
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), |
26
|
|
|
|
27
|
|
|
new Orbitale\Bundle\CmsBundle\OrbitaleCmsBundle(), |
28
|
|
|
); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
public function registerContainerConfiguration(LoaderInterface $loader) |
32
|
|
|
{ |
33
|
|
|
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); |
34
|
|
|
|
35
|
|
|
if ($this->isSymfony3()) { |
36
|
|
|
$loader->load(function (ContainerBuilder $container) { |
37
|
|
|
$container->loadFromExtension('framework', array( |
38
|
|
|
'assets' => null, |
39
|
|
|
)); |
40
|
|
|
}); |
41
|
|
|
} |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @return string |
46
|
|
|
*/ |
47
|
|
|
public function getCacheDir() |
48
|
|
|
{ |
49
|
|
|
return __DIR__.'/../../../build/cache/'.$this->getEnvironment(); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @return string |
54
|
|
|
*/ |
55
|
|
|
public function getLogDir() |
56
|
|
|
{ |
57
|
|
|
return __DIR__.'/../../../build/kernel_logs/'.$this->getEnvironment(); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @return bool |
62
|
|
|
*/ |
63
|
|
|
private function isSymfony3() |
64
|
|
|
{ |
65
|
|
|
return 3 === Kernel::MAJOR_VERSION; |
66
|
|
|
} |
67
|
|
|
} |
68
|
|
|
|