This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Forwards compatibility with v3 releases #76
Merged
weierophinney
merged 16 commits into
zendframework:develop
from
weierophinney:feature/forwards-compat
Feb 28, 2016
Merged
Forwards compatibility with v3 releases #76
weierophinney
merged 16 commits into
zendframework:develop
from
weierophinney:feature/forwards-compat
Feb 28, 2016
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Sets new target version to be 2.7.0. - Updates dependencies to known-stable, forwards-compatible versions. - Updates test matrix: - Test against v2 and v3 versions. - Run each against each supported PHP version.
This patch re-introduces the following classes from the `Zend\Mvc\Service` namespace, along with related tests: - `ConfigFactory` - `ControllerLoaderFactory` - `DiAbstractServiceFactoryFactory` - `DiFactory` - `DiServiceInitializerFactory` - `DiStrictAbstractServiceFactory` - `DiStrictAbstractServiceFactoryFactory` It also re-instates the `ServiceManagerAware` and `ServiceLocatorAware` initializers in the `ServiceManagerConfig` class (though they will now emit deprecation notices), and ensures that class properly defines services such that they'll be accessible identically between v2 and v3 of zend-servicemanager.
…eners Not necessary with shipped, stable versions of zend-servicemanager.
- Re-introduced `createService()` method, proxying to `__invoke()`. - Re-defined invokables as aliases + invokable factories. - Re-enabled form abstract factory.
- Ensured each extend the appropriate v2 interface/class, and implement the required methods for both v2 and v3. - Added `setInvokableClass()` implementation to `RoutePluginManager` to mimic work in `configure()` for v2.
Updated all factories to ensure they work with both v2 and v3 of zend-servicemanager. Primarily, this consisted of re-adding the `createService()` method as a proxy to `__invoke()`. Updated all abstract factories to ensure they implement both the v2 and v3 methods. Updated all plugin managers to ensure they implement both the v2 and v3 methods, define appropriate default services, and utilize the v2 properties for "auto add invokables" and "share by default".
- Defer until after testing the instance, to allow injection in retrieved instances (vs lazy-instantiated ones).
Restores behavior to be backwards compatible; if the event manager, request, and/or response are not passed to the constructor, they are pulled from the service manager.
…ibility Removed previous workflow from v2 with regards to: - instantiation and initial configuration of the SM - Retrieving the SM from the ServiceListener post-module loading (no longer necessary)
- Require zend-authentication 2.5.3 or up (first version to allow zend-stdlib 3.0 support)
These changes provide basic v3 compability, allowing the tests to at least run (though not pass). In particular: - The `ConfigFactory` was only targeting v2 previously; it's now forwards-compatible with v3. - The `RoutePluginManager` had two issues: - `configure()` had the wrong visibility. - `setInvokableClass()` is a method that changes signature between v2 and v3. Since the logic in the `RoutePluginManager` duplicates that in v3, it was removed. - The EventManager factory, and any tests that were instantiating and injecting an EventManager with a shared event manager, received updates to allow varying instantiation based on version. v2 does not accept a shared manager to the constructor, and requires injection via `setSharedManager()`; v3 requires injection via the constructor, and removes the `setSharedManager()` method entirely.
- Updated `Forward` plugin to work with both v2 and v3 API of `SharedEventManagerInterface::getListeners()`. - `ViewHelperManagerFactory` updates: - Fixed typo when registering Doctype helper factory. - All override factories now pull the parent service locator when under zend-servicemanager v2. - Throw `InvalidServiceException`, not `InvalidServiceNameException`, from `DiStrictAbstractServiceFactory` (latter does not exist in v3) - Test fixes: - `config`, not `Config`, service - `Request`, not `request`, service - do not grab return value of mutators on SM instances - use Prophecy to get SM/plugin manager instances (ensuring that constructor arguments can be ignored)
weierophinney
added a commit
that referenced
this pull request
Feb 28, 2016
weierophinney
added a commit
that referenced
this pull request
Feb 28, 2016
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch provides forwards compatibility with version 3 releases of zend-servicemanager and zend-eventmanager, vs v3-compatibility-only per previous changes on the develop branch. As such, it now targets a future 2.7.0 release vs a 3.0.0 release.
Changes include:
ConfigFactory
was re-instated.ServiceManagerAware
andServiceLocatorAware
were re-introduced for backwards compatibility, but now emit deprecation notices when invoked.Zend\ServiceManager\FactoryInterface
(v2 and v3) instead ofZend\ServiceManager\Factory\FactoryInterface
(v3-only)createService()
method, as a proxy to__invoke()
.Zend\ServiceManager\AbstractFactoryInterface
(v2 and v3) instead ofZend\ServiceManager\Factory\AbstractFactoryInterface
(v3-only)canCreateServiceWithName()
method tocanCreate()
canCreateServiceWithName()
method proxying tocanCreate()
createServiceWithName()
to__invoke()
createServiceWithName()
method proxying to__invoke()
.The changes so far are in the source code only, not tests, and, as such, this is a work-in-progress.
TODO
ServiceListener
/ServiceManagerConfig
/Application
dance, back to the v2 workflow.MiddlewareListener
andRouteInvokableFactory
.