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

Consume zend-router and remove internal Router subcomponent #99

Merged

Conversation

weierophinney
Copy link
Member

Now that zend-router has been split out, we can remove it from the zend-mvc distribution, and add zend-router as a dependency.

Changes required:

  • Removal of the Zend\Mvc\Router subcomponent and related tests.
  • Removal of Zend\Mvc\Service factories that are now in zend-router.
  • All references to the Router subcomponent were updated to reference the new namespace.
  • Updated the various Router entries in the ServiceListener to refer to the factories from zend-router.
  • To prevent issues with alias resolution, updated several tests to define a Router factory that simply returns the HttpRouter service.
  • The PRG plugin test needed to change the name of one expected exception; it likely should have been updated sooner, regardless.

TODO

  • remove the entry for the ConsoleRouter, as this will be optional functionality provided by zend-mvc-console, and will not need to be mapped in the ServiceListener.
  • [ ] zend-view needs to be updated to consume zend-router; as such we'll need to update this PR again in the future to reference the new zend-view version once it's tagged. This can and should be merged before zend-view is updated; we'll just need to update once zend-view is updated.
  • experiment with having the tests use the zend-router Module for providing service mappings, to see if it can be consumed seamlessly that way.
  • since console routes are removed from zend-router, and zend-mvc-console now exists, remove all console functionality.

@weierophinney weierophinney added this to the 2.8.0 milestone Mar 9, 2016
@weierophinney weierophinney modified the milestones: 3.0.0, 2.8.0 Mar 21, 2016
@weierophinney
Copy link
Member Author

Labeling as a WIP, as I plan to get this working with zend-router v3.

This patch updates the component to use zend-router 3.0, allowing the
removal of the entire `Zend\Mvc\Router` namespace, as well as related
factories in the `Zend\Mvc\Service` namespace.

Tests were updated to reflect the change. One set of tests, for the url
controller plugin, were marked skipped, as they rely on zend-view being
updated to use zend-router.

TODO
----

- [ ] once zend-view is updated, update the dependencies in this patch.
- [ ] experiment with having tests use zend-router as a module/config
  provider, to see if they can pass.
This patch updates the `ServiceListener` to remove all router entries,
in favor of consuming zend-router as a module/configuration provider.

For tests to pass, this required changes to test setup entries to do one
of the following:

- add the `Zend\Router` module to the list of active modules, relying on
  the `ModuleManager` to aggregate and configure its factories.
- pull dependency configuration from the zend-router `ConfigProvider`
  when setting up initial dependencies for minimal tests that do not use
  the `ModuleManager` for application initialization.
zend-mvc-console now provides all console-related integration between zend-mvc,
zend-router, and zend-view, allowing it to be removed from this component. Doing
this as part of the zend-router removal, as otherwise you cannot actually route
to console-related controllers.
Broken against zend-servicemanager v2, as it was using constant notation
instead of a string when invoking itself.
@weierophinney weierophinney removed the WIP label Mar 23, 2016
@weierophinney weierophinney merged commit 679d582 into zendframework:develop Mar 24, 2016
weierophinney added a commit that referenced this pull request Mar 24, 2016
weierophinney added a commit that referenced this pull request Mar 24, 2016
@weierophinney weierophinney deleted the feature/zend-router branch March 24, 2016 13:29
@boesing boesing mentioned this pull request Apr 27, 2017
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