I have an application where I want to implement the following system. In certain key places of code, I'll have lines such as
$event_handler->trigger('on_after_init');
This line will announce that initialization has just been finished. Then I want to have some random extensions/plugins listening to this and other events and execute whatever code they want to. For example something like a plugins/after_init/... where you can put a class that will get executed. Or may be I'll keep them in DB so that I could also adjust the order if needed.
While I can build something like that, I feel that this is a classical task and that there is a standard pattern for that. I don't want to invent bicycle so in case this is really so, please point me to the relevant information.
Thanks!