Skip to content

Commit

Permalink
Conditionally add ServiceListenerFactory in ModuleManagerFactory
Browse files Browse the repository at this point in the history
- Only if the SM does not already have a ServiceListener factory should
  we add it. This allows substituting a different factory if desired.
  • Loading branch information
weierophinney committed Jul 25, 2012
1 parent 4f7b6a8 commit 3da19a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/Zend/Mvc/Service/ModuleManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ class ModuleManagerFactory implements FactoryInterface
*/
public function createService(ServiceLocatorInterface $serviceLocator)
{
$serviceLocator->setFactory('ServiceListener', 'Zend\Mvc\Service\ServiceListenerFactory');
if (!$serviceLocator->has('ServiceListener')) {
$serviceLocator->setFactory('ServiceListener', 'Zend\Mvc\Service\ServiceListenerFactory');
}

$configuration = $serviceLocator->get('ApplicationConfig');
$listenerOptions = new ListenerOptions($configuration['module_listener_options']);
Expand Down

0 comments on commit 3da19a7

Please sign in to comment.