Skip to content
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

Closed
hlecorche opened this issue Nov 6, 2015 · 5 comments
Closed

Ivory is deprecated in favor of php-http #56

hlecorche opened this issue Nov 6, 2015 · 5 comments

Comments

@hlecorche
Copy link

Ivory is used but it's deprecated in favor of php-http.

@judgej
Copy link

judgej commented May 18, 2016

It is now totally abandoned. Composer warning is:

Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead.

@lstrojny
Copy link
Owner

lstrojny commented May 19, 2016

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).

@judgej
Copy link

judgej commented May 19, 2016

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.

@lstrojny
Copy link
Owner

@judgej no worries, I don't plan to implement a PSR-7 implementation. All I am wondering is if I do the dependencies (dev dependencies vs normal dependencies) right in #60.

@lstrojny
Copy link
Owner

Fixed in 0.12.0. Take a look at the upgrade guide for 0.12.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants