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

ServiceManager v2 + v3 compatibility #16

Merged

Conversation

weierophinney
Copy link
Member

This patch updates the component to work with both v2 and v3 of zend-servicemanager. Specifically:

  • Updates the dependency to ^2.7.2 || ^3.0 (2.7.2 is the first version that contains all features that allow plugin managers to work correctly across both versions)
  • Updates the two plugin manager implementations to:
    • Add $shareByDefault, with a value equivalent to $sharedByDefault (former is v2, latter is v3).
    • Implement both validate() and validatePlugin(), with the latter proxying to the former.

Tests currently pass with either v2 or v3; I'm currently working on travis configuration to allow testing against both; I've updated the travis matrix to run additional tests for each PHP version, with the default being against v3.0.3, and the alternate against v2.7.5+.

Marked as WIP, as it has a hard-dependency on zend-validator, and thus cannot be completed until a stable version of that component with forwards-compatibility is ready.

Updates zend-servicemanager dependency to `^2.7.2 || ^3.0`.

(v2.7.2 has the fixes that make plugin manager refactors work.)
This only needed to touch the plugin manager implementations. The following
changes were made:

- Introduced `$shareByDefault` property, with same value as `$sharedByDefault`.
- Introduced implementations for both `validate()` and `validatePlugin()`.
@weierophinney weierophinney added this to the 2.6.0 milestone Jan 11, 2016
- php: `^5.5 || ^7.0`
- zend-stdlib: `^2.7 || ^3.0`
- zend-validator: `^2.6`
- zend-servicemanager `^2.7.5 || ^3.0.3`
- zend-config `^2.6`
- Do not prefer dev or unstable dependencies
- updated test matrix
Added compatibility tests for the object and renderer plugin managers,
and fixed several inconsistencies between them, including:

- varying exception based on servicemanager version
- ensuring appropriate aliases are in place
- ensuring v2 factory names (as resolved by aliases) are in place
@weierophinney weierophinney removed the WIP label Feb 17, 2016
@weierophinney weierophinney merged commit 3a1ca10 into zendframework:develop Feb 17, 2016
weierophinney added a commit that referenced this pull request Feb 17, 2016
weierophinney added a commit that referenced this pull request Feb 17, 2016
@weierophinney weierophinney deleted the feature/sm-forwards-compat branch February 17, 2016 19:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant