Hi all,

tl;dr: Looking for one or more sponsors so I can apply for a PECL account, to 
submit a new extension for server-side PHP request and response objects (*not* 
HTTP messages per se; see below).

* * *

From time to time we've all heard the complaint that PHP has no built-in 
request/context object to represent the execution environment. Userland ends up 
writing these themselves, and they all end up being tied to specific library 
collections or frameworks. Same thing for a response object, to handle the 
output going back to the web client. I've written them myself more than once.

After doing some library and framework research (linked later) it looks like 
there is a reasonable  common set of request/response functionality across all 
of them, and that would also be useful to non-framework users.

I wrote up a userland implementation for that limited common subset of 
functionality, and John Boehr then used that as a reference point for the C 
version. It's PHP 7.x only.

You can see the result at <https://gitlab.com/pmjones/phprequest>.

The extension provides fundamental server-side request and response objects for 
PHP. They are not HTTP message objects proper. They are more like wrappers for 
existing global PHP variables and functions, with some limited additional 
convenience functionality.

It provides two classes:

- StdRequest, essentially a read-only struct composed of PHP superglobals and 
some other commonly-used values

- StdResponse, essentially a wrapper around (and buffer for) response-related 
PHP functions, with some additional convenience methods, and self-sending 

The userland reference implementation is in the "refimpl/" directory, and the 
research sources are in "refimpl/notes/".

It seems like the next step, then, is for an existing PECL person to sponsor my 
application to PECL, so I can register for an account, then submit this work to 
PECL via whatever collaboration process is appropriate.

I'm happy to answer any questions, and undergo any criticism, that you may have 
regarding this.

So: any sponsors want to take this up?


Paul M. Jones

PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to