How can some code in a bundle be executed after booting the Symfony2 kernel?
The reason I need this is that I need to register a stream wrapper. I need to be able to use the bundle configuration since the stream wrapper definitions are defined in the config.
I tried the following:
kernel.request
and console.command
(This will cause the code to be executed multiple times when the kernel handles multiple requests during its lifetime.)You can override the boot
method of your bundle.
class MyBundle extends Bundle
{
public function boot()
{
}
}
You can register one service as event listener for both kernel.request
and console.command
. It will be fired from console and from HTTP request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With