Silex icon indicating copy to clipboard operation
Silex copied to clipboard

SwiftmailerServiceProvider deletes options set before registering

Open pradador opened this issue 13 years ago • 1 comments

I created an app following the layout found in https://github.com/lyrixx/Silex-Kitchen-Edition. The general flow is that a Silex application is first created, configuration settings are set, and finally service providers are registered.

It seems that the SwiftmailerServiceProvider is not compatible with this strategy as it is clearing the options I set in my config file via the $app['swiftmailer.options'] settings. My guess is that the first statement in the register method ($app['swiftmailer.options'] = array();) is causing this. If I set the options via the second parameter of the register method, the settings work as expected.

Please advise if this is expected behavior and I should change my loading strategy or if it's possible to change the strategy the service provider follows when registering. Thanks!

pradador avatar Apr 11 '13 04:04 pradador

This is the expected behavior: https://github.com/fabpot/Silex/commit/9766faf0616a67cd0ff7437950d5453deebac9c4

GromNaN avatar Apr 11 '13 07:04 GromNaN