You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 16, 2026. It is now read-only.
Looks like this library comes with it's own implementation of HTTP messages, almost identical to those defined in PSR-7 standard, but not compatible on interface level. I can see that:
UriInterface can be used directly
RequestInterface and ResponseInterface are almost compatible
streams are different, as they need to support async operations
I think it is worth to build building some kind of bridge between this implementations, for the sake of compatibility. It won't be very elegant if you think about good OOP practices, but it's going to be very pragmatic - say someone develops PSR-7 library for detecting mobile devices using headers, it could be used directly from within icicle/http app.
This "bridge" can be implemented in many different ways. As an example, Request class could have following methods:
publicfunctiongetBody()
{
thrownewRuntimeException("Synchronous stream is not supported");
}
publicfunctiongetAsyncBody() // ...or whatever name would be better
{
return$this->stream;
}
You get incompatible getBody(), but everything else (headers, uri) can be used as always.
What do you think? I could create a PR with example bridge implementation.
Looks like this library comes with it's own implementation of HTTP messages, almost identical to those defined in PSR-7 standard, but not compatible on interface level. I can see that:
UriInterfacecan be used directlyRequestInterfaceandResponseInterfaceare almost compatibleI think it is worth to build building some kind of bridge between this implementations, for the sake of compatibility. It won't be very elegant if you think about good OOP practices, but it's going to be very pragmatic - say someone develops PSR-7 library for detecting mobile devices using headers, it could be used directly from within
icicle/httpapp.This "bridge" can be implemented in many different ways. As an example, Request class could have following methods:
You get incompatible getBody(), but everything else (headers, uri) can be used as always.
What do you think? I could create a PR with example bridge implementation.