-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMicroKernel.php
More file actions
56 lines (48 loc) · 1.68 KB
/
MicroKernel.php
File metadata and controls
56 lines (48 loc) · 1.68 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
<?php
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\RouteCollectionBuilder;
/**
* @author Koen Vinken <vinkenkoen@gmail.com>
*/
class MicroKernel extends Kernel
{
use MicroKernelTrait;
/*
* {@inheritDoc}
*/
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new AppBundle\AppBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
}
return $bundles;
}
/*
* {@inheritDoc}
*/
protected function configureRoutes(RouteCollectionBuilder $routes)
{
if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
$routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml', '/_wdt');
$routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml', '/_profiler');
}
$routes->import('@AppBundle/Controller', '/', 'annotation');
}
/*
* {@inheritDoc}
*/
protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader)
{
$loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
}
}