Zend_Controller_Router 2.0 RoadMap
Refactoring of Zend_Controller_Router_Rewrite
Goal
The current layout of the router and it's routes is not very flexible and was not made for the problems it currently tries to solve. Thus, it is going under refactoring to solve the drawbacks. In general, the following topics should be covered with the new router:
- Lightweight: Should be as fast or if possible even faster than the current implementation
- Design by contract: The router and it's routes get covered by interfaces
- The router should completly work with the request object instead of URL-strings
- Fixing bugs which are hard to fix without a BC-break
Routes
- The getInstance() method will be removed from all routes. Instead we will use a unified constructor
- getDefault() and getDefaults() will become interface methods
- The match() method will only allow an instance of Zend_Controller_Request_Http
Building routes via config
The router will allow to not only give complete class names for the route types, but also just the actual route name (module, regex, chain, etc.). This allows for much less typing-work.
Interfaces
- Zend_Controller_Router_RouterInterface
- Zend_Controller_Router_RouteInterface
- Zend_Controller_Router_Rewrite_RouteInterface (extends Zend_Controller_Router_RouteInterface)
Classes
- Zend_Controller_Router_Rewrite
- Zend_Controller_Router_Rewrite_Route_Module
- Zend_Controller_Router_Rewrite_Route_Standard (or any other suggestions?)
- Zend_Controller_Router_Rewrite_Route_Chain
- Zend_Controller_Router_Rewrite_Route_Regex
CS-Cleanup
Currently the router doesn't follow the coding standard completly, this will be solved together with the refactoring.
Labels:
None