laminas / laminas-modulemanager

Modular application system for laminas-mvc applications
https://docs.laminas.dev/laminas-modulemanager/
BSD 3-Clause "New" or "Revised" License
30 stars 18 forks source link

Load module if not Loaded #31

Closed nusphere closed 2 years ago

nusphere commented 2 years ago

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

So far it has been possible to reload corresponding module dependencies in a module via the init method. @see ModuleManagerInterface::loadModule

Unfortunately, this can lead to side effects if the desired dependency is already loaded and possibly preconfigured by a previous module.

The current behavior would reload and also initialize the dependency. As a result, any configurations in the dependency are now obsolete.

For this reason, I would like to see a new method in the interface that only loads the corresponding dependency if it is not already loaded (ModuleManagerInterface::loadModuleIfNotLoaded)

nusphere commented 2 years ago

this issue is no longer necessary as it is more of a bug. the behavior described here should already be supported. @see https://github.com/laminas/laminas-modulemanager/issues/32