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

Support zend-servicemanager v2+v3 #22

Merged
merged 12 commits into from
Feb 10, 2016

Conversation

weierophinney
Copy link
Member

This patch builds on the one originally submitted via #21, and expands it to provide support for both v2 and v3 of zend-servicemanager. Specifically, it introduces the following changes:

  • composer.json:
    • Updates PHP version to ^5.5 || ^7.0
    • Updates develop branch alias to 2.6
    • Updates zend-servicemanager requirement to ^2.7.2 || ^3.0
  • Code changes:
    • Updated LoaderPluginManager to implement both validate() and validatePlugin() (latter proxies to former).
    • Updated TranslatorServiceFactory to implement both v2 and v3 factory methods, with v2 method proxying to v3.
    • Updated HelperConfig:
      • define aliases + invokable factories;
    • alter configureServiceManager to call SM methods setters instead of configure() (for portability)
    • implemented toArray() (v3 method)
    • Updated TranslatorTest to use Config objects + configureServiceManager() method to seed SM and plugin manager instances.

ezimuel and others added 4 commits January 8, 2016 17:37
…anager

Fixed the plugin with the new Service Manager version
- `composer.json`:
  - Updates PHP version to `^5.5 || ^7.0`
  - Updates develop branch alias to `2.6`
  - Updates zend-servicemanager requirement to `^2.7.2 || ^3.0`
- Code changes:
  - Updated `LoaderPluginManager` to implement both `validate()` and
    `validatePlugin()` (latter proxies to former).
  - Updated `TranslatorServiceFactory` to implement both v2 and v3 factory
    methods, with v2 method proxying to v3.
  - Updated `HelperConfig`:
    - define aliases + invokable factories;
    - alter `configureServiceManager` to call SM methods setters instead of
      `configure()` (for portability)
    - implemented `toArray()` (v3 method)
  - Updated `TranslatorTest` to use Config objects + `configureServiceManager()`
    method to seed SM and plugin manager instances.
@weierophinney weierophinney added this to the 2.6.0 milestone Jan 12, 2016
@weierophinney
Copy link
Member Author

Labeled as a WIP, as several dependencies are on components that also bring in SM refactors, but which have not been updated to support both v2 and v3 of the SM (only v3). As such, the CI checks on this will fail until those are updated.

@ezimuel
Copy link
Contributor

ezimuel commented Jan 20, 2016

@weierophinney can you update the composer.json and .travis to use zend-servicemanager 2.7.3?

Adds the pattern used in zendframework/zend-serializer#8 for determining
which version of each library to use when testing.
@weierophinney
Copy link
Member Author

@ezimuel Done! I made it test against the v2 and v3 versions of both the service manager and event manager while I was at it.

Pins all requirements to stable versions, selecting versions
forwards-compatible with zend-stdlib and zend-servicemanager 3.0 where
available. For those that are not, we will omit them from testing when testing
forwards compatibility.
Omits tests utilizing features from zend-view, zend-validator, and zend-cache
when their classes are unavailable, and omits installing those components when
performing forwards-compatibility tests for zend-servicemanager v3.
Adds `LoaderPluginManagerCompatibilityTest` to allow ensuring the
`LoaderPluginManager` is forwards compatible with zend-servicemanager v3, and
fixes several inconsistencies.

Additionally, updates the `Zend\I18n\View\HelperConfig::$factories` definition
to add the legacy (v2) canonicalized helper keys required for plugin managers to
remain v2 compatible.
- Fixed argument name for `LoaderPluginManager::validatePlugin()`
  implementation so that it's consistent with the definition.
- Rewrote `triggerUntil()` methods as `triggerEventUntil()`, as the
  `triggerUntil()` argument order changes between v2 and v3.
- Use the `config` service, not the `Config` or `Configuration` service.
- Mock against container-interop, not `ServiceLocatorInterface`
@weierophinney weierophinney removed the WIP label Feb 10, 2016
@weierophinney weierophinney merged commit 95991a5 into zendframework:develop Feb 10, 2016
weierophinney added a commit that referenced this pull request Feb 10, 2016
weierophinney added a commit that referenced this pull request Feb 10, 2016
@weierophinney weierophinney deleted the feature/21 branch February 10, 2016 16:36
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.

None yet

2 participants