Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nusphere opened this issue Apr 8, 2022 · 0 comments · May be fixed by #34
Open

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

nusphere opened this issue Apr 8, 2022 · 0 comments · May be fixed by #34
Labels
Bug Something isn't working

Comments

@nusphere
Copy link

nusphere commented Apr 8, 2022

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:

  • as a manual (namespace) string -> 'Laminas\Form'
  • as a class string specification of the module class -> \Laminas\Form\Module::class

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

@nusphere nusphere added the Bug Something isn't working label Apr 8, 2022
nusphere added a commit to nusphere/laminas-modulemanager that referenced this issue Apr 8, 2022
nusphere added a commit to nusphere/laminas-modulemanager that referenced this issue Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
1 participant