fabpot/Silex — pull request #202 by igorw (2011-10-27 17:55:00+00:00)
Title: Create default set of listeners late

Right now the following subscribers are created together with the
dispatcher:

* app
* exception_handler
* ResponseListener
* RouterListener

With the exception_handler in particular this is an issue because you
can no longer change it after the dispatcher has been created. And it
gets created when you call before(), after() or error(). It means that
you cannot unset it for tests.

The RouterListener has a similar issue because you can no longer change
the UrlMatcher it uses. And you cannot move its creation into a request
listener, because request listeners cannot add other request listeners
(the new ones won't get executed anymore at that point).

This commit ensures that those listeners will be created a lot later,
allowing their dependencies to be modified before runtime.