Closed RalfEggert closed 8 years ago
@RalfEggert Don't forget the unit tests! (See Travis)
Fixed the tests
@RalfEggert Some more:
Zend\Mvc
. Maybe we can remove it and add only Zend\Router
to composer.json
.Zend\Permissions
from the "suggest" part to "require" in composer.json
. (See Zend\Navigation\Page\AbstractPage
)@RalfEggert you can look at https://github.com/zendframework/zend-view/blob/master/src/Helper/Url.php
It consumes both Zend\Mvc\Router and Zend\Router.
@vaclavvanik
Please move this problem to the Zend\View
issue tracker. Thanks!
Btw. That's a good point!
@froschdesign I meant @RalfEggert can look at Zend\View\Helper\Url because this helper could be used with both Zend\Mvc 2.0 and 3.0. Ralfs changes are Mvc 3.0 imho.
@vaclavvanik
You are right. I thought you mean the Zend\Navigation
view helpers. :grin:
It consumes both Zend\Mvc\Router and Zend\Router.
This is an option for a next minor release in version 2 of Zend\Navigation
. For version 3 with can remove Zend\Mvc
– after a deeper look into the code base.
The only dependency to Zend\Mvc left is in https://github.com/zendframework/zend-navigation/blob/develop/src/Page/Mvc.php It uses the two constants ModuleRouteListener::ORIGINAL_CONTROLLER
and ModuleRouteListener::MODULE_NAMESPACE
.
Not sure about the Zend\Permissions
. It is used in https://github.com/zendframework/zend-navigation/blob/develop/src/Page/AbstractPage.php and already added to the require-dev
section in composer.json.
@RalfEggert I noticed that Travis was reporting test failures for zend-mvc v2 (and servicemanager, etc.). I took the liberty of pulling locally and figuring out how to get things running. This included:
Mvc
page type to inline the zend-mvc ModuleRouteListener
constants, which removes the concrete dependency on zend-mvc. It's still needed for tests, as we have some integration tests with that class.Mvc
page type tests to vary what type of router artifacts to use based on what version of zend-mvc is installed; if zend-mvc v2 is installed, it uses Zend\Mvc\Router\*
classes, while for v3 it uses Zend\Router\*
classes.I've tested locally with both an updated composer.lock
, as well as running --prefer-lowest
, and it appears to work well! I'm opening a competing PR that incorporates your work just to ensure that tests pass against travis; if they do, I'll issue a 2.8.0 release.
Thanks for doing the heavy-lifting, @RalfEggert !
:+1:
Make Zend\Navigation compatible with Zend\Mvc and Zend\Router