Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3936 from blanchonvincent/hotfix/improve-zend-tes…
Browse files Browse the repository at this point in the history
…t-and-remove-sendresponselisetener

Improve the remove of SendResponseListener
  • Loading branch information
weierophinney committed Mar 11, 2013
2 parents 4805c2e + 6a211d3 commit 4831c93
Showing 1 changed file with 2 additions and 7 deletions.
Expand Up @@ -15,7 +15,6 @@
use Zend\Http\Request as HttpRequest; use Zend\Http\Request as HttpRequest;
use Zend\Mvc\Application; use Zend\Mvc\Application;
use Zend\Mvc\MvcEvent; use Zend\Mvc\MvcEvent;
use Zend\Mvc\SendResponseListener;
use Zend\Stdlib\Exception\LogicException; use Zend\Stdlib\Exception\LogicException;
use Zend\Stdlib\Parameters; use Zend\Stdlib\Parameters;
use Zend\Stdlib\ResponseInterface; use Zend\Stdlib\ResponseInterface;
Expand Down Expand Up @@ -154,12 +153,8 @@ public function getApplication()
$this->application = Application::init($appConfig); $this->application = Application::init($appConfig);


$events = $this->application->getEventManager(); $events = $this->application->getEventManager();
foreach ($events->getListeners(MvcEvent::EVENT_FINISH) as $listener) { $events->detach($this->application->getServiceManager()->get('SendResponseListener'));
$callback = $listener->getCallback();
if (is_array($callback) && $callback[0] instanceof SendResponseListener) {
$events->detach($listener);
}
}
return $this->application; return $this->application;
} }


Expand Down

0 comments on commit 4831c93

Please sign in to comment.