Skip to content
Browse files

Merge pull request #22 from PeerJ/AllowDisableOfFlashMessageListener

Allow disable of flash message listener
  • Loading branch information...
2 parents ff24c93 + e31b0d2 commit c06862819b4b07a670f5dc9f0fac199abd19cab4 @dbu dbu committed Jan 7, 2013
Showing with 5 additions and 1 deletion.
  1. +4 −0 DependencyInjection/Configuration.php
  2. +1 −1 DependencyInjection/LiipCacheControlExtension.php
View
4 DependencyInjection/Configuration.php
@@ -91,7 +91,11 @@ private function addFlashMessageListenerSection(ArrayNodeDefinition $rootNode)
->children()
->arrayNode('flash_message_listener')
->canBeUnset()
+ ->treatFalseLike(array('enabled' => false))
+ ->treatTrueLike(array('enabled' => true))
+ ->treatNullLike(array('enabled' => true))
->children()
+ ->scalarNode('enabled')->defaultTrue()->end()
->scalarNode('name')->defaultValue('flashes')->end()
->scalarNode('path')->defaultValue('/')->end()
->scalarNode('domain')->defaultNull()->end()
View
2 DependencyInjection/LiipCacheControlExtension.php
@@ -63,7 +63,7 @@ public function load(array $configs, ContainerBuilder $container)
$loader->load('authorization_request_listener.xml');
}
- if (!empty($config['flash_message_listener'])) {
+ if (!empty($config['flash_message_listener']) && $config['flash_message_listener']['enabled']) {
$loader->load('flash_message_listener.xml');
$container->setParameter($this->getAlias().'.flash_message_listener.options', $config['flash_message_listener']);

0 comments on commit c068628

Please sign in to comment.
Something went wrong with that request. Please try again.