added http packages
This commit is contained in:
parent
5831e1187e
commit
c47470140f
2 changed files with 18 additions and 1 deletions
|
@ -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"
|
||||
},
|
||||
```
|
||||
|
||||
|
|
17
4-http.md
17
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...
|
Loading…
Reference in a new issue