New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ivory is deprecated in favor of php-http #56
Comments
It is now totally abandoned. Composer warning is:
|
There is #60, but honestly I have no idea what I am doing. Maybe you could help me testing it as I am still kinda shocked of the complexity that PSR-7 seems to add (or I am just too stupid). |
PSR-7 is just a way to define an interface to a value object that can hold a request or response. That is really all it is. What may make it complex is the number of methods that the interface defines. This means knocking up a quick implementation is not trivial as you need to deal with all those methods, although those methods are mostly simple. Luckily there are a few good implementations out there. PSR-7 is quite low level. It does not help you to create or parse the meaning of a request or response message. To do that, you need to know the HTTP and feed that into the PSR-7 objects. The construction of a PSR-7 message (e.g. to upload a file) can be hard, but that is not part of what PSR-7 is. The good implementations out there will handle all that complexity for you though. However, not being a part of PSR-7, this means they all do it in a slightly different way. So you need to either choose an implementation and stick with it, or create some simple adapters that can be used to normalise that additional functionality. So my advice is: don't try to write a PSR-7 message implementation; use Guzzle or Diabola or one of the others. Do understand where PSR-7 stops and starts. Do understand where the implementations provide wrapper functions to make creating messages easy, and that all the implementations have the same additional functions in general and are different, but are similar enough to be able to write adapters to make them easily swappable. To my mind, this is the stuff that is never made clear when the idea of "using PSR-7" is sold to projects. The result is that it confuses people, ends up with lots of unnecessary code being written, and often locks libraries into specific implementations, which is one thing PSR-7 was meant to avoid. |
Fixed in 0.12.0. Take a look at the upgrade guide for 0.12.x |
Ivory is used but it's deprecated in favor of php-http.
The text was updated successfully, but these errors were encountered: