Skip to content

Commit

Permalink
merged branch GromNaN/patch-6 (PR silexphp#442)
Browse files Browse the repository at this point in the history
Commits
-------

a51a9a1 Make the event dispatcher class configurable.

Discussion
----------

Make the event dispatcher class configurable.

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

This PR allows @davedevelopment to use a customized class like this silexphp#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.
  • Loading branch information
fabpot committed Sep 18, 2012
2 parents 122c9ba + a51a9a1 commit e7ac638
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Silex/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\RequestContext;
Expand Down Expand Up @@ -86,8 +85,9 @@ public function __construct()
return new ExceptionHandler();
});

$this['dispatcher_class'] = 'Symfony\\Component\\EventDispatcher\\EventDispatcher';
$this['dispatcher'] = $this->share(function () use ($app) {
$dispatcher = new EventDispatcher();
$dispatcher = new $this['dispatcher_class']();
$dispatcher->addSubscriber($app);

$urlMatcher = new LazyUrlMatcher(function () use ($app) {
Expand Down

0 comments on commit e7ac638

Please sign in to comment.