Commit e7ac638c authored by Fabien Potencier's avatar Fabien Potencier

merged branch GromNaN/patch-6 (PR #442)

Commits
-------

a51a9a14 Make the event dispatcher class configurable.

Discussion
----------

Make the event dispatcher class configurable.

<del>After 81bafcc6</del> There is no easy way to modify event dispatcher class.

This PR allows @davedevelopment to use a customized class like this #426.

---------------------------------------------------------------------------

by igorw at 2012-07-18T12:36:52Z

+1

---------------------------------------------------------------------------

by davedevelopment at 2012-07-18T12:41:07Z

+1, I'll settle for this :)

---------------------------------------------------------------------------

by stof at 2012-07-18T16:23:00Z

To be clear, the commit you linked is a revert of a change committed by mistake in the previous commit just a few minutes earlier.

---------------------------------------------------------------------------

by GromNaN at 2012-07-18T20:59:12Z

@stof indeed.
parents 122c9ba9 a51a9a14
...@@ -32,7 +32,6 @@ use Symfony\Component\HttpFoundation\RedirectResponse; ...@@ -32,7 +32,6 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\EventDispatcher\Event; use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Routing\RouteCollection; use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\RequestContext; use Symfony\Component\Routing\RequestContext;
...@@ -86,8 +85,9 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe ...@@ -86,8 +85,9 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
return new ExceptionHandler(); return new ExceptionHandler();
}); });
$this['dispatcher_class'] = 'Symfony\\Component\\EventDispatcher\\EventDispatcher';
$this['dispatcher'] = $this->share(function () use ($app) { $this['dispatcher'] = $this->share(function () use ($app) {
$dispatcher = new EventDispatcher(); $dispatcher = new $this['dispatcher_class']();
$dispatcher->addSubscriber($app); $dispatcher->addSubscriber($app);
$urlMatcher = new LazyUrlMatcher(function () use ($app) { $urlMatcher = new LazyUrlMatcher(function () use ($app) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment