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

Fix issue with plugin manager detection in ServiceLocatorAware initializer #114

Merged

Conversation

weierophinney
Copy link
Member

As reported in zendframework/zend-servicemanager#109, the "ServiceLocatorAware" initializer in zend-mvc breaks under the latest zend-servicemanager v2 versions due to mis-detection of the service container. Because both the SM instance itself and plugin managers implement ContainerInterface, the conditional used to detect a v3 variant of zend-servicemanager emits a false positive, as it falsely identifies the plugin manager as the service container.

This patch adds an additional conditional, checking against specifically AbstractPluginManager, so that it can properly identify which argument is the container, and which is the instance to initialize.

Fixes zendframework/zend-servicemanager#109

…lizer

As reported in zendframework/zend-servicemanager#109, the "ServiceLocatorAware"
initializer in zend-mvc breaks under the latest zend-servicemanager v2 versions
due to mis-detection of the service container. Because both the SM instance
itself and plugin managers implement `ContainerInterface`, the conditional used
to detect a v3 variant of zend-servicemanager emits a false positive, as it
falsely identifies the plugin manager as the service container.

This patch adds an additional conditional, checking against specifically
`AbstractPluginManager`, so that it can properly identify which argument is the
container, and which is the instance to initialize.
@weierophinney weierophinney added this to the 2.7.4 milestone Apr 3, 2016
@weierophinney weierophinney self-assigned this Apr 3, 2016
@weierophinney weierophinney merged commit 581e921 into zendframework:master Apr 3, 2016
weierophinney added a commit that referenced this pull request Apr 3, 2016
weierophinney added a commit that referenced this pull request Apr 3, 2016
@weierophinney weierophinney deleted the hotfix/servicemanager-109 branch April 3, 2016 16:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant