[SecurityBundle] Lazily load the post schema listener
This commit is contained in:
parent
673bbb8a8e
commit
c68c8b87c3
@ -90,8 +90,7 @@ class MainConfiguration implements ConfigurationInterface
|
|||||||
->arrayNode('acl')
|
->arrayNode('acl')
|
||||||
->children()
|
->children()
|
||||||
->scalarNode('connection')
|
->scalarNode('connection')
|
||||||
->defaultValue('default')
|
->defaultNull()
|
||||||
->cannotBeEmpty()
|
|
||||||
->setInfo('any name configured in doctrine.dbal section')
|
->setInfo('any name configured in doctrine.dbal section')
|
||||||
->end()
|
->end()
|
||||||
->arrayNode('cache')
|
->arrayNode('cache')
|
||||||
|
@ -133,13 +133,16 @@ class SecurityExtension extends Extension
|
|||||||
{
|
{
|
||||||
$loader->load('security_acl_dbal.xml');
|
$loader->load('security_acl_dbal.xml');
|
||||||
|
|
||||||
$container->setAlias('security.acl.dbal.connection', sprintf('doctrine.dbal.%s_connection', $config['connection']));
|
if (null !== $config['connection']) {
|
||||||
|
$container->setAlias('security.acl.dbal.connection', sprintf('doctrine.dbal.%s_connection', $config['connection']));
|
||||||
|
}
|
||||||
|
|
||||||
$container
|
$container
|
||||||
->getDefinition('security.acl.dbal.schema_listener')
|
->getDefinition('security.acl.dbal.schema_listener')
|
||||||
->addTag('doctrine.event_listener', array(
|
->addTag('doctrine.event_listener', array(
|
||||||
'connection' => $config['connection'],
|
'connection' => $config['connection'],
|
||||||
'event' => 'postGenerateSchema'
|
'event' => 'postGenerateSchema',
|
||||||
|
'lazy' => true
|
||||||
))
|
))
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user