Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Remove dependency of Zend\ModuleManager on Zend\Mvc #6933

Closed
RalfEggert opened this issue Nov 26, 2014 · 6 comments
Closed

Remove dependency of Zend\ModuleManager on Zend\Mvc #6933

RalfEggert opened this issue Nov 26, 2014 · 6 comments
Assignees
Milestone

Comments

@RalfEggert
Copy link
Contributor

The Zend\ModuleManager has a hard dependency on Zend\Mvc within these two listeners:

  • Zend\ModuleManager\Listener\OnBootstrapListener
  • Zend\ModuleManager\Listener\LocatorRegistrationListener

Both listeners use the MvcEvent::EVENT_BOOTSTRAP constant. If you want to use the ModuleManager standalone, for example within a Console application based on https://github.com/zfcampus/zf-console, you need to install Zend\Mvc and all of its dependencies.

It would be quite helpful if this hard dependency could be removed though I have no idea how to do this.

@RalfEggert
Copy link
Contributor Author

I looked into it again and thought that I found a solution. We could use the ListenerOptions to inject the MvcEvent::EVENT_BOOTSTRAP constant and use this constant within the two listeners. But that would mean to add the constant to Zend\ModuleManager\Listener\ListenerOptions somehow which does not really solve the issue.

Has anyone any other idea?

@Ocramius
Copy link
Member

Is the constant the only dependency? Because we can get rid of that eventually...

@Ocramius
Copy link
Member

We can safely hardcode the string there, then (or move it to a reference to a constant that is internal to the ModuleManager component).

@RalfEggert
Copy link
Contributor Author

Tried to solve it by the PR #7060

Would that be ok?

@Ocramius Ocramius added this to the 2.3.4 milestone Dec 22, 2014
@Ocramius Ocramius self-assigned this Dec 22, 2014
@Ocramius
Copy link
Member

Handled in #7060

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants