On 26/09/2016 20:37, Paul Jones wrote:
tl;dr: Gauging interest in an extension for server-side PHP request and
response objects (*not* HTTP messages per se; see below) prior to writing an
RFC for them on the wiki.
This sounds like an interesting project, but I have a few questions.
First, the obvious one: why does this need to be an extension and/or
built into core? Are there reasons such as performance for implementing
this in C rather than PHP? Does it provide functionality that is hard to
implement in a userland library?
You mention that it is not just an HTTP wrapper, but although you
mention researching other frameworks, I can't see any reference to PSR-7
[http://www.php-fig.org/psr/psr-7/]. What do you see as the relationship
between your proposal and that standardisation effort?
Regarding the design of the objects themselves, why is stdRequest
property-only, but stdResponse method-only? The asymmetry feels awkward
to me.
I think the most interesting parts are those that attempt to rationalise
$_SERVER, and I think a library (or built-in functionality) devoted to
those could be very useful. Some of that overlaps with PSR-7, but that
standard doesn't go into depth on things like Accept headers,
Authentication, etc.
Like I say, it's an interesting idea, but I'm not sure how it fits in
with the wider ecosystem.
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php