forked from symfony/demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppKernel.php
More file actions
67 lines (58 loc) · 2.71 KB
/
AppKernel.php
File metadata and controls
67 lines (58 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;
class AppKernel extends Kernel
{
public function registerBundles()
{
// When you install a third-party bundle or create a new bundle in your
// application, you must add it in the following array to register it
// in the application. Otherwise, the bundle won't be enabled and you
// won't be able to use it.
$bundles = [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
new CodeExplorerBundle\CodeExplorerBundle(),
new AppBundle\AppBundle(),
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(), // used for initial population of non-SQLite databases in production envs
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
];
// Some bundles are only used while developing the application or during
// the unit and functional tests. Therefore, they are only registered
// when the application runs in 'dev' or 'test' environments. This allows
// to increase application performance in the production environment.
if (in_array($this->getEnvironment(), ['dev', 'test'])) {
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
if ('test' === $this->getEnvironment()) {
// this bundle makes it easier to work with databases in PHPUnit
// tests, so it's only loaded for the 'test' environment
$bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle();
}
}
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(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
}