Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Changed the previous fix as per pull req #2350 discussion

  • Loading branch information...
commit 41c67b101867945fed52d59bc10a20c5f81542ec 1 parent 7044bb1
Dragos Badea authored
28 library/Zend/ModuleManager/Listener/LocatorRegistrationListener.php
@@ -66,26 +66,26 @@ public function onLoadModulesPost(Event $e)
66 66 $moduleManager = $e->getTarget();
67 67 $events = $moduleManager->getEventManager()->getSharedManager();
68 68
69   - if(false !== $events){
70   - // Shared instance for module manager
71   - $events->attach('Zend\Mvc\Application', 'bootstrap', function ($e) use ($moduleManager) {
72   - $moduleClassName = get_class($moduleManager);
73   - $application = $e->getApplication();
74   - $services = $application->getServiceManager();
75   - if (!$services->has($moduleClassName)) {
76   - $services->setService($moduleClassName, $moduleManager);
77   - }
78   - }, 1000);
  69 + if(!$events){
  70 + return;
79 71 }
80 72
  73 + // Shared instance for module manager
  74 + $events->attach('Zend\Mvc\Application', 'bootstrap', function ($e) use ($moduleManager) {
  75 + $moduleClassName = get_class($moduleManager);
  76 + $application = $e->getApplication();
  77 + $services = $application->getServiceManager();
  78 + if (!$services->has($moduleClassName)) {
  79 + $services->setService($moduleClassName, $moduleManager);
  80 + }
  81 + }, 1000);
  82 +
81 83 if (0 === count($this->modules)) {
82 84 return;
83 85 }
84 86
85   - if(false !== $events){
86   - // Attach to the bootstrap event if there are modules we need to process
87   - $events->attach('Zend\Mvc\Application', 'bootstrap', array($this, 'onBootstrap'), 1000);
88   - }
  87 + // Attach to the bootstrap event if there are modules we need to process
  88 + $events->attach('Zend\Mvc\Application', 'bootstrap', array($this, 'onBootstrap'), 1000);
89 89 }
90 90
91 91 /**

0 comments on commit 41c67b1

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