Where to register EventListeners to work via MVC and CLI

Looks like EventListeners are totally ignored when code is executed via laminas-cli.

The Reason is that neither Module::onBoostrap() nor the config key ‘listeners’ is handled by lamainas-cli.

But what’s the alternative? Where in a Laminas Module can EventListeners be configured / attached savely?

Looks like Module::init() ist the only place where code is excecuted in any case. But from this method there’s no access to the Service-Manager an therefor no way to fetch and attach the Listeners. :confused:

On each module, i have a ServiceLayer that triggers events to the EventManager. (i.E. ‘model-xy::entity:saved’, ‘session:sign-in’, ‘bussines-process:abc:finished’, …)

In other modules i need to attach to those Events. Not only on MVC Requests but also on laminas-cli calls. i.E. ‘busines-prozess:abc:finished’ might happen via MVC but might also happen via laminas-cli.

Any suggestion is appreciated

Thanks in advance

Please check the issue tracker of laminas-cli there will you find your answer. For example:

But apparently no one is interested in solving the problem, but only in demanding that it must work. :man_shrugging:t2:

Got it, thanks.

I’ll give it a try …

Thank you for pushing the topic! :+1:t2: