From c47470140f4ac052c8f66834b4737d58652e6138 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 12 Sep 2014 23:49:22 +0200 Subject: [PATCH] added http packages --- 3-error-handler.md | 2 +- 4-http.md | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/3-error-handler.md b/3-error-handler.md index 2738b8c..0002c3b 100644 --- a/3-error-handler.md +++ b/3-error-handler.md @@ -13,7 +13,7 @@ To install a new package, open up your `composer.json` and add the package to th ``` "require": { "php": ">=5.5.0", - "filp/whoops": "~1.0" + "filp/whoops": ">=1.1.2" }, ``` diff --git a/4-http.md b/4-http.md index bdda196..576a977 100644 --- a/4-http.md +++ b/4-http.md @@ -6,4 +6,21 @@ PHP already has a few things built in to make working with HTTP easier. For exam These are good if you just want to get a quick and dirty script runnin. But if you want to write clean, maintanable, [SOLID](http://en.wikipedia.org/wiki/SOLID_%28object-oriented_design%29) code, then you will want a class with a nice object oriented interface that you can use in your application. +Once again, you don't have to reinvent the wheel and just install a package. I decided to write my own [HTTP component](https://github.com/PatrickLouys/http). + +Some alternatives: [Symfony HttpFoundation](https://github.com/symfony/HttpFoundation), [Nette HTTP Component](https://github.com/nette/http), [Aura Http](https://github.com/auraphp/Aura.Http), [sabre/http](https://github.com/fruux/sabre-http) + +In this tutorial I will use my own HTTP component, but of course you can use whichever package you like most. Just change the code accordingly. + +Again, edit the `composer.json` to add the new component and then run `composer update`: + +``` +"require": { + "php": ">=5.5.0", + "filp/whoops": ">=1.1.2", + "patricklouys/http": ">=1.0.2" +}, +``` + + to be continued... \ No newline at end of file