Commit Graph

37 Commits

Author SHA1 Message Date
PJ Dietz 1c82908eeb Refactor Router to use RouteTables 2015-02-21 08:10:58 -05:00
PJ Dietz 04561076d5 Update Router to work with updated Routes and ErrorHandlers
Deprecate:
	- Router::setStaticRoute
	- Router::setPrefixRoute
2015-02-19 22:04:34 -05:00
PJ Dietz 1a88e0273d Use registered 404 error handler when no route matches in Router::respond 2015-01-21 09:51:14 -05:00
PJ Dietz ca2c8625ec Store PrefixRoutes to a separate array.
Prioritize routes in the order static, prefix, everything else.
2015-01-02 13:13:08 -05:00
PJ Dietz caef817535 Do not allow routing to continue after a dispatched StaticRoute returns null 2015-01-02 12:31:02 -05:00
PJ Dietz 78fe57d736 Store StaticRoutes to separate hash array in Router
Add StaticRouteInterface
2015-01-02 12:00:30 -05:00
Phil 6ae85398db Just making silly mistakes now... 2015-01-01 20:43:07 +00:00
Phil b6ec262d0e Forgot to catch exceptions in static routes 2015-01-01 20:38:57 +00:00
Phil 451a1c0576 Trying to stop not set error... 2015-01-01 20:27:45 +00:00
Phil aaaf644118 Initialized response to null to be safe 2015-01-01 20:21:17 +00:00
Phil bb052625af Made sure not to iterate over StaticRoutes again because the key they map to is a specific child Handler 2015-01-01 20:17:48 +00:00
Phil b0c1330a26 Optimized for static routes 2015-01-01 19:44:33 +00:00
PJ Dietz 9eec436ad4 Add error handlers to Router
Move catching HttpExceptions and translating into responses from Handler to Router
2015-01-01 12:41:53 -05:00
Phil 07c55bb70b no error handlers case 2014-12-31 21:12:29 +00:00
Phil cc17ebbe48 Added support for custom error handlers 2014-12-31 21:06:06 +00:00
PJ Dietz 75088499b8 Ensure $args propagate from Router to Handlers 2014-08-02 17:42:16 -04:00
PJ Dietz 7d3f4442b4 Code style 2014-07-27 16:52:59 -04:00
PJ Dietz 1c5d95e727 Router::getResponse() now returns null to allow better nesting
Runs tests that output responses in process isolation
2014-07-26 19:05:38 -04:00
PJ Dietz b601c38d36 Add tests for Router 2014-07-14 00:19:04 -04:00
PJ Dietz 8aa6b91d91 Update documentation on Router and Message 2014-07-13 17:41:52 -04:00
PJ Dietz aa06181e40 Refactor DispatcherInterface to HandlerInterface
Update file doc blocks
Code inspection
2014-06-29 10:43:39 -04:00
PJ Dietz 12b971dfe6 Add convenience methods to Router
Code cleanup and inspection
2014-06-28 20:12:55 -04:00
PJ Dietz f60b010f11 Update Router class to match new DispatcherInterface 2014-06-28 20:03:36 -04:00
PJ Dietz 8f99b88d09 Reduce number of interfaces and classes
Remove RouterInterface, Route, and RouteTarget
Change signature of DispatcherInterface::getResponse() to include args
Update classes to match new DispatcherInterface::getResponse()

This update simplifies the API significantly with most classes now
simply needing to implement DispatcherInterface
2014-06-28 19:42:05 -04:00
PJ Dietz e3e98377c3 Track route depth on the Request, not on the Router.
This allows a Handler to use the top-level router and have the depth count match the depth for the current request, not the total.
2013-08-16 18:59:05 -04:00
PJ Dietz d91ac12541 Add safeguard against infinite routing loops 2013-08-16 17:49:37 -04:00
PJ Dietz 6013198436 Allow Routers to dispatch additional Routers
- RouterInterface and HandlerInterface now share a parent, RouteTargetInterface.
- A Router may now be used as the target for a Route.
- Route's handler member is not replaced by Router's target member.
- Route::getHandler() and Route::setHandler() are deprecated and alias getTarget() and setTarget()
2013-08-16 16:51:09 -04:00
PJ Dietz fafce16e9e Update README. Add default 500 error to Router. Close #3 2013-05-27 12:59:55 -04:00
PJ Dietz 98e04ab63b Define interfaces more clearly and clean up code. 2013-05-26 14:55:48 -04:00
PJ Dietz b28b53aa11 Add interfaces for Route and Handler 2013-05-23 19:49:43 -04:00
PJ Dietz 47ec8f5f96 Code cleanup and refactoring 2013-05-19 12:59:57 -04:00
PJ Dietz d0ef6a62fb Updates to documentation for better documentation generation
Refactored WellrestedException to WellRESTedException
2013-01-29 20:59:55 -05:00
PJ Dietz e419aaba7d Add page-level doc blocks to each script
Update comments
Update magic accessors
Update accessor and add islet and unset methods
2013-01-28 22:15:33 -05:00
PJ Dietz 298bdab35f Update Router and Route to require autoloading
Update samples to use new Router and Route
Refactor ApiSample namespace
2013-01-24 21:48:44 -05:00
PJ Dietz 8597b9be06 Refactor for better PSR compliance. Still need to finish with samples. 2013-01-24 21:27:57 -05:00
PJ Dietz 3ff2371edd Make specifying the path to the handler script optional in Route since it is not needed if using an autoloader. 2013-01-10 21:21:57 -05:00
PJ Dietz 331bdae7ec Refactor library files into src/pjdietz/WellRESTed 2013-01-10 20:54:22 -05:00