merged branch fabpot/boot (PR #330)
Commits ------- c7536412 added the ServiceProviderInterface::boot() method Discussion ---------- 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 --------------------------------------------------------------------------- by fabpot at 2012-05-26T09:59:48Z We can avoid the BC break by creating a new `BootableServiceProviderInterface` but it seems overkill (especially because we are not stable yet). --------------------------------------------------------------------------- by stof at 2012-05-26T10:36:05Z👍 And I agree that adding a new interface is overkill --------------------------------------------------------------------------- by igorw at 2012-05-27T18:14:06Z I'm not so happy with the BC break and that an additional method is required, but I can't think of any better way to solve this cleanly. So I guess let's go for it.
Showing
Please register or sign in to comment