zendframework/zf2 — pull request #768 by Ocramius (2012-02-03 00:37:11+00:00)
Title: Mvc router from locator

These changes allow the router to be fetched from the locator.

Basically, I'm hereby telling `Zend\Di` that the instantiator for `Zend\Mvc\Router\RouteStack` is `Zend\Mvc\Router\Http\TreeRouteStack::factory`.

This allows us to use the interface FQCN itself to retrieve the router, and gives us more flexibility than just having injections in the router and the router itself injectable.

It is possible to completely replace it by redefining the instantiator definition in configuration.

A change has been applied in the `Zend\Di` namespace to allow using `Di#get($interfaceName)`.

Changes have also been applied to `Zend\Mvc\Router\RouteStack` mainly to allow setter injection, but are also useful regardless of `Zend\Di`.