Commit Graph

264 Commits

Author SHA1 Message Date
PJ Dietz 891f86f024 Update README 2014-07-24 21:23:10 -04:00
PJ Dietz 1a21b2b7d0 Add Client class
Move Request::request() to Client::request()
2014-07-24 20:41:32 -04:00
PJ Dietz ad1e5a1782 Add tests for Handler 2014-07-14 01:01:51 -04:00
PJ Dietz 982e048b4f Move HttpExceptions to their own namespace 2014-07-14 01:01:41 -04:00
PJ Dietz 1e32c66cb5 Always clean body on HEAD request 2014-07-14 01:01:15 -04:00
PJ Dietz ecb58c11b8 Clean up unused imports 2014-07-14 01:00:38 -04:00
PJ Dietz b601c38d36 Add tests for Router 2014-07-14 00:19:04 -04:00
PJ Dietz efd1843603 Remove output buffering functions from setup() and tearDown() 2014-07-14 00:18:54 -04:00
PJ Dietz 0d1adaa767 Update PHPUnit config file 2014-07-13 23:56:34 -04:00
PJ Dietz 794d0901b9 Fix documentation and add tests for Response 2014-07-13 23:56:19 -04:00
PJ Dietz 581c3d1351 Update documentation and add tests for Request 2014-07-13 21:39:01 -04:00
PJ Dietz 8aa6b91d91 Update documentation on Router and Message 2014-07-13 17:41:52 -04:00
PJ Dietz 6a642dfed2 Fix documentation and add tests for BaseRoute 2014-07-13 17:18:08 -04:00
PJ Dietz e597926634 Fix documentation and add tests for TemplateRoute 2014-07-13 17:08:15 -04:00
PJ Dietz f11c13c1b3 Fix documentation and add tests for RegexRoute 2014-07-13 16:27:09 -04:00
PJ Dietz 921d84cf8b Update StaticRoute documentation and add tests 2014-07-13 15:50:30 -04:00
PJ Dietz 97836e7fa0 100% on RouteBuilder 2014-07-13 14:50:23 -04:00
PJ Dietz 18d3d6c9db Update RouteBuilder docs and add test
- Remove RouteBuilder::buildRoutesFromJson()
- Allow RouteBuilder::buildRoutes() to parse JSON
- Add PHPUnit
- Add tests for RouteBuidler
- Update docs for RouteBuilder
- Update README RouteBuilder example
- Rename constant in BaseRoute
2014-07-13 14:29:37 -04:00
PJ Dietz ae9fbaa709 Add phpdoc for HttpException and subclasses. 2014-07-13 10:26:01 -04:00
PJ Dietz aec8bcca4a Fix phpdoc for interfaces, Handler. 2014-07-13 10:12:12 -04:00
PJ Dietz 3be61bfb07 Fix phpdoc in Handler 2014-07-13 09:22:13 -04:00
PJ Dietz c61b2197ea Remove @package tag from phpdoc throughout. 2014-07-13 09:00:38 -04:00
PJ Dietz d9840067db Fix typos in exception names. 2014-07-11 15:01:25 -04:00
PJ Dietz 47fdc0e31b Add HTTP Exceptions and convert to responses in Handler 2014-07-10 22:47:05 -04:00
PJ Dietz 25c423e0ee Simplify Request::getRequestHeaders() 2014-07-08 20:21:23 -04:00
PJ Dietz 08cf2f4ec2 Fix typos 2014-06-29 10:51:51 -04:00
PJ Dietz 4be631615c Begin version 2.0 README 2014-06-29 10:43:57 -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 3718e03c78 Add RouteBuilder class for parsing route configurations 2014-06-29 02:11:52 -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 618058850d Add Route classes
Route is now replaced with several classes descending from BaseRoute.
Each of these routes takes care of autoloading and instantiated the
RouteTargetInterface instead of leaving that to the Router.
2014-06-28 18:44:09 -04:00
PJ Dietz 086dd62f05 Bugfixes from removing magic methods 2014-06-28 18:30:27 -04:00
PJ Dietz c1937e8a33 Remove magic methods from Message 2014-06-28 16:24:16 -04:00
PJ Dietz 566384f1e4 Promote Response::getStatusLine() to public
Fix issue where response phrase was not set in Response constructor.
2014-04-07 16:25:22 -04:00
PJ Dietz 8049635837 Add ability to read response body from a file without reading the entire file into memory 2014-03-19 15:13:29 -04:00
PJ Dietz a756adf933 Update RequestInterface to inherit from RouteableInterface 2013-08-25 23:05:13 -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 dbd4ff96a5 Split response into headers and body based on the size of the headers cURL reports.
Fixes an issue with 100 Continue status codes, etc. where r\n\r\n appears within the list of headers.
2013-08-14 10:47:02 -04:00
PJ Dietz 8268daedfb Merge pull request #5 from nthdesign/master
Tiny change to the README.md file.
2013-06-24 18:04:45 -07:00
Nate Smith 84b70f3c09 Change the name of the local variable $router to $myRouter to match the preceding code fragment. 2013-06-24 20:44:07 -04:00
PJ Dietz fef677168e Allow Request::readHttpRequest to work when apache_request_headers is not available. 2013-06-12 19:54:08 -04:00
PJ Dietz 7f4ab73048 Fix types in README.md 2013-05-27 14:56:53 -04:00
PJ Dietz ebe4021b95 Add change log 2013-05-27 14:53:02 -04:00
PJ Dietz e693e138d0 Add support for OPTIONS and generate Allow header from Handler. Close #4 2013-05-27 14:13:16 -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 8aae07660c Add port to Request class. Allow user to supply cURL options. Close #2
Caller can now supply array of options for use with curl_setopt_array() when calling Request::request()
2013-05-26 18:32:26 -04:00