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

Forwards compatibility with zend-servicemanager v3 #20

Merged

Conversation

weierophinney
Copy link
Member

This patch reverts some of the changes from #5 in favor of making the component forwards compatible with v3. Specifically:

  • Updates dependencies to known-stable, forwards compatible versions where possible, with the following specific changes:
    • Updated zend-stdlib to ^2.7 || ^3.0
    • Updated zend-servicemanager to ^2.7.5 || ^3.0.3
    • Removed zend-modulemanager (not used)
  • Updates the test matrix to specify the version of zend-servicemanager to use, and to test each version against each PHP version in the matrix. For tests against the zend-servicemanager v3 series, zend-mvc is removed from the dependencies.
  • Updates all factory implementations to use the v2 interfaces (in v3, these inherit from the new interfaces).
  • Updates all factory implementations implement the v2-specific methods (these proxy to the v3 methods).
  • Simplifies test setup in the ServiceFactory significantly, and reverts v3-specific zend-servicemanager setup to use setup compatible with both versions.

Additionally, this patch updates the Zend\Navigation\View\HelperConfig class to ensure it works correctly against both v2 and v3 releases of zend-servicemanager. In particular, it adds testing to the class, which uncovered an interesting situation: the documented navigation_helpers configuration previously did not work! With this patch, it now works correctly, regardless of version.

- Updated zend-stdlib to `^2.7 || ^3.0`
- Updated zend-servicemanager to `^2.7.5 || ^3.0.3`
- Updated to known-stable, forwards compatible dependencies where possible.
- Removed zend-modulemanager (not used)
- Setup test matrix to specify version of zend-servicemanager to use; each
  version is tested against each PHP version as well. For 3.0.3 tests, zend-mvc
  is removed.
- Updated all factory implementations to use the v2 variants, which
  inherit the v3 methods in v3.
- Added implementations for v2-specific factory methods.
- Updated test codebase to use zend-servicemanager mutation methods
  instead of `configure()`.
- Simplified test setup; application bootstrapping was unnecessary,
  and was simpler to achieve via straight SM configuration.
@weierophinney
Copy link
Member Author

Marked as WIP, as realized the aliases and factory names listed in Zend\Navigation\View\HelperConfig need to be updated, based on feedback since the zend-view 2.6 release series..

Re-enabled the `HelperConfig` tests, refactored to approximate the zend-mvc
workflow, and watched the bugs start appearing. In the end, this became a
substantial refactor:

- This adds a factory for `Zend\View\Helper\Navigation`, to ensure it gets
  injected with the application-level service locator.
- It also adds a delegator factory for the navigation view helper that ensures
  that the `HelperConfig` is used to configure the plugin manager composed in
  the navigation helper. This ensures that any `navigation_helpers`
  configuration is used, allowing developers to override or add to the
  navigation helpers.
- The `HelperConfig` was also updated to ensure it works in both v2 and v3 of
  the service manager, and registers invokables as a combination of
  `InvokableFactory` mappings and aliases (if the service name and class
  differ).

Essentially, I'm not sure how the `navigation_helpers` configuration *ever*
worked, even in versions prior to the migration. It works now.
@weierophinney
Copy link
Member Author

No longer a WIP; all tested and working now!

@weierophinney weierophinney merged commit d6462d4 into zendframework:develop Feb 24, 2016
weierophinney added a commit that referenced this pull request Feb 24, 2016
weierophinney added a commit that referenced this pull request Feb 24, 2016
@weierophinney weierophinney deleted the feature/forwards-compat branch February 24, 2016 21:45
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