fabpot/Silex — pull request #330 by fabpot (2012-05-26 09:54:49+00:00)
Title: added the ServiceProviderInterface::boot() method

The `register` method for the service providers should only be about configuring services and parameters. But some service providers (monolog, swiftmailer, and session) also register some event listeners which means that the `dispatcher` service is created.

This makes some things impossible like replacing the `dispatcher` service (except if you make sure to override it *before* the other providers). Also, if you want to use Monolog for the logger, it won't work as there is a chicken and egg problem.

So, I propose to introduce a new `boot()` method on `ServiceProviderInterface` that must be called after all the providers are registered.

The `boot()` method is automatically called by the `handle()` method if not already called by the developer.

TODO: update the doc