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

loadModule reinitializes modules if the module has already been loaded #32

Open nusphere opened 2 years ago

nusphere commented 2 years ago

Bug Report

Q A
Version(s) 2.11.0

Summary

When reloading a dependency within a module, the module should only be reloaded if it has not already been loaded.

Current behavior

However, this is only the case if the naming of the dependency is exactly the same.

It is now possible to specify modules as dependencies in 2 ways:

if you now use both ways in your application (as part of a longer-term conversion to the 'new' class string specification), this function no longer works and the module is loaded twice and initialized 2 times.

Any configurations made before the second initialization will be overwritten.

How to reproduce

Expected behavior