• Fabien Potencier's avatar
    merged branch igorw/late-listeners (PR #202) · c100a49e
    Fabien Potencier authored
    Commits
    -------
    
    43ae6965 fix comment in LazyUrlMatcher
    4d5ffca8 add test case for late listeners
    51df9f5a Create default set of listeners late
    
    Discussion
    ----------
    
    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.
    c100a49e
Name
Last commit
Last update
doc Loading commit data...
src/Silex Loading commit data...
tests Loading commit data...
vendor Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
autoload.php Loading commit data...
compile Loading commit data...
composer.json Loading commit data...
example.htaccess Loading commit data...
phpunit.xml.dist Loading commit data...
update_vendors.sh Loading commit data...