Re: RFC: Server-Side Request and Response Objects (v2)
| From: | Paul M. Jones | Date: | Thu, 13 Feb 2020 16:08:07 +0000 |
| Subject: | Re: RFC: Server-Side Request and Response Objects (v2) | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108541@lists.php.net to get a copy of this message | ||
Hi Ruud,
> On Feb 13, 2020, at 00:45, Ruud Boon <ruudboon@php.net> wrote:
>
> Hi!
>
> I really like this RFC.
Glad to hear it!
> In the the RFC I see that $content will return php://input using file_get_contents on the fly.
> Can we add the possibility to get a reference to the stream as well?
By "get a reference" I presume you mean "an open file handle" (a la
return
fopen('php://input', 'rb')).
In which case: maybe? I can see where that would be useful for extremely large request bodies in a
memory-constrained environment.
But the question becomes: is that needed frequently-enough across a wide-enough range of PHP
developers to warrant inclusion in this RFC? I don't recall seeing any userland implementation
from my research provide such a thing. That makes me think it's a comparatively infrequent
need.
If many others disagree with that assessment, I'm happy to entertain the possibility of adding
something like it to ServerRequest.
--
Paul M. Jones
pmjones@pmjones.io
http://paul-m-jones.com
Modernizing Legacy Applications in PHP
https://leanpub.com/mlaphp
Solving the N+1 Problem in PHP
https://leanpub.com/sn1php