-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathVictoireCoreBundle.php
40 lines (33 loc) · 1.21 KB
/
VictoireCoreBundle.php
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
<?php
namespace Victoire\Bundle\CoreBundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Victoire\Bundle\CoreBundle\DependencyInjection\Compiler\AccessMapCompilerPass;
use Victoire\Bundle\CoreBundle\DependencyInjection\Compiler\TraductionCompilerPass;
/**
* Awesome Cms for Symfony2
*/
class VictoireCoreBundle extends Bundle
{
/**
* create admin menu, add listeners for generate contextual menu item and dispatch globals item menus
*/
public function boot()
{
$driverChain = $this->container->get('doctrine.orm.entity_manager')->getConfiguration()->getMetadataDriverImpl();
$proxyDriver = $this->container->get('victoire_core.entity_proxy.cache_driver');
$driverChain->addDriver($proxyDriver, 'Victoire');
}
/**
* Build bundle
* @param ContainerBuilder $container
*/
public function build(ContainerBuilder $container)
{
parent::build($container);
if ($container->hasDefinition('jms_translation.config_factory')) {
$container->addCompilerPass(new TraductionCompilerPass());
}
$container->addCompilerPass(new AccessMapCompilerPass());
}
}