zendframework / zend-modulemanager

ModuleManager component from Zend Framework
BSD 3-Clause "New" or "Revised" License
44 stars 27 forks source link

[Q&A] ServiceListener filling ServiceManager during Module loads #70

Closed reinfi closed 6 years ago

reinfi commented 7 years ago

I just want to know if there is a particular reason why the ServiceListener fills the service manager after all modules are loaded. (Reacts LOAD_MODULES_POST event).

Why could it not fill the service manager everytime a module is loaded?

This would be really helpful because now it is important that any listener who listens on the LOAD_MODULES_POST event is registered after the service listener priority. Otherwise you could not get any dependency from the service manager.

A simple solving would be to register the ServiceListener with a very high priority but that would more a hot fix than a real solution.

If there is no particular reason for it and it would also be possible to fill the service manager while loading the modules, I would be happy to submit a pull request.