php-http / message-factory

Abandoned: Httplug Factory interfaces for PSR-7 HTTP Message
http://php-http.org
MIT License
1.38k stars 10 forks source link

Create ServerRequestFactory.php #33

Closed barryvdh closed 7 years ago

barryvdh commented 8 years ago

Based on the existing RequestFactory and the proposed PSR-17 interface: https://github.com/php-fig/fig-standards/blob/master/proposed/http-factory/http-factory.md

barryvdh commented 8 years ago

Both Guzzle and Diactoros support this, so would be nice to have :)

dbu commented 8 years ago

would this be a temporary solution until PSR-17 is finalized? do you know the state of PSR-17? i would prefer not to start providing an interface here that will be obsoleted by PSR-17 in short time...

barryvdh commented 8 years ago

Isn't that the same for the other interfaces? And yes, I would prefer PSR-17.

Not sure what the status is, I don't see a lot of progress in the FIG mailinglist. It does have some activity in https://github.com/http-interop/http-factory but not sure what the progress is.

barryvdh commented 8 years ago

In the repo mentioned above, I do see some discussion still about the globals: https://github.com/http-interop/http-factory/pull/21 Which makes sense imo.

dbu commented 8 years ago

afaik we wrote those interfaces before PSR-17 was a thing. our intention is to replace the interfaces we have here with the PSR-17 ones once its released.

lets ping @shadowhand to hear his opinion on the state of PSR-17 and if he has an idea when it might be ready.

i tend to say we should rather wait for PSR-17 than release something that will create confusion once PSR-17 is released.

sagikazarmark commented 8 years ago

WTF, where did my comment go?

Anyway, I don't think we should drop support for this after PSR-17 is out as we have plenty of stuff relying on it. My plan is to provide bridges in both directions.

As such, I don't see any reason why we could not accept this change.

Nyholm commented 8 years ago

I believe that one intention for PSR-17 is to make sure it is compatible with Httplug.

The state of PSR-17 has stalled a bit. There was a lot of activity a month ago but some less now. I think it is just temporary though. It will be more discussion soon. =)

There has been some changes to the PSR-17 ServerRequest lately and there is currently one open PR

Anyway, I don't think we should drop support for this after PSR-17 is out as we have plenty of stuff relying on it. My plan is to provide bridges in both directions.

My opinion is that we should not drop support rather deprecate. There is at least a year before we can see an accepted PSR-17 so I would like us to create a ServerRequest that users can use now.

dbu commented 8 years ago

i did not mean drop as in immediately remove, but as in fade out and recommend to use the PSR-17 interfaces. but if you expect PSR-17 to take another year, it makes sense to provide something reasonably close until then.

tobias, do you see anything with the interface we should adjust, or can this be merged as is?

barryvdh commented 8 years ago

I think we should wait if a conclusion is reached on https://github.com/http-interop/http-factory/pull/21 first.

sagikazarmark commented 8 years ago

I agree with @Nyholm, we cannot just drop support because that would mean we have to release new major versions, which I would not do just for the sake of using other interfaces. I would initially introduce bridges for that and when we have other changes (like the HTTPlug PSR) I would increase major version, and drop support for our interfaces.

sagikazarmark commented 8 years ago

Well, we need to continue supporting these factories, so I don't see a problem in adding these here. Although I am not sure that writting new software which relies on it makes sense.

But in any case, we will provide bridges for PSR-17.

Barry vd. Heuvel notifications@github.com ezt írta (2016. október 24., hétfő):

In the repo mentioned above, I do see some discussion still about the globals: http-interop/http-factory#21 https://github.com/http-interop/http-factory/pull/21 Which makes sense imo.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/php-http/message-factory/pull/33#issuecomment-255676793, or mute the thread https://github.com/notifications/unsubscribe-auth/ABK2kIb-hpLqzQBkdRGT1YAF2MiWBicFks5q3GnwgaJpZM4Kef_d .

barryvdh commented 7 years ago

Closing this, as it's not implemented differently in the concept PSR-17; https://github.com/http-interop/http-factory/blob/master/src/ServerRequestFactoryInterface.php