Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96158 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89717 invoked from network); 26 Sep 2016 21:19:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Sep 2016 21:19:56 -0000 Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.178 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 209.85.220.178 mail-qk0-f178.google.com Received: from [209.85.220.178] ([209.85.220.178:34165] helo=mail-qk0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BC/C2-04248-9F099E75 for ; Mon, 26 Sep 2016 17:19:55 -0400 Received: by mail-qk0-f178.google.com with SMTP id n185so183423458qke.1 for ; Mon, 26 Sep 2016 14:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Bk/5NAQOrQ6J+/J6rmKwHzTOwG9jWKmcp2OR+8n9ct8=; b=ZgevMuXGIgSG6n9ohtnBwE3pxKEO07GD2vCBWZqwcU7TZbdi7be5kAujmfNayvjEQN e1kChBnJhT/FvOn1OJM/unE9EMirEst23U7pNNTs6uZB55qYjTrB0auo1XPS+9u6yQ2d Fm32/Sa/dIEcYdBqAMtTwg4+zowyt1342Ns7mkbwbN95peQL6zTK0WsF56o+zl3D0j+E ob81Robb0c1c1TSCM4J8XO/0nUmJs6nssZ9Qq3HYXhkiOyO+3D+BjDzOZx7DIAllJwI/ eW6s6I1+PDR3Haqzb0LMcZoKZumjJKL6Q+gpRyL+nPm/ghhcA4sY4cLvk+58kZNcWBsG Uy8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Bk/5NAQOrQ6J+/J6rmKwHzTOwG9jWKmcp2OR+8n9ct8=; b=D6g4n2MN3j6onAZ7V7WSlV/j/lkVEOrZlujqELpiwaNBspS6yAJXwoUze0l01Vq6Po WK+WQ24HfAmFw3oRn1ujBxv2BsnAfcolO/DWH5DPED+3FVnz9wGHEVUv9iQC0pujAotT pOwEbnLbZb91majxNl+kdrECJiYtncimEaOq73Ni3N+ORyIE7gwHtbHzcWK3XqBpbeWs u5odM/gq3HNBpWHY1yZAgy+H0tNMFcs1YzYQ3y2AyayEL/sWRcEf+LBddTVH7b399J2w hIWo1UlfeqyP18fuPaqBHc8GKM5s9N+vQtvw3cx5QyILoeBazDtFIYMix1J2Ytsw2ufN 6eIw== X-Gm-Message-State: AA6/9RlWiQt8lELoJ0nosw5SJURDOzKiNyU/S2KPRWwfCq8ffoQj0D2Yx93Lds8UNa9+VwytdDJAm2yA42aJxA== X-Received: by 10.194.155.100 with SMTP id vv4mr20362331wjb.56.1474924791135; Mon, 26 Sep 2016 14:19:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.19.229 with HTTP; Mon, 26 Sep 2016 14:19:50 -0700 (PDT) Received: by 10.194.19.229 with HTTP; Mon, 26 Sep 2016 14:19:50 -0700 (PDT) In-Reply-To: References: Date: Mon, 26 Sep 2016 23:19:50 +0200 Message-ID: To: Paul Jones Cc: PHP Internals List Content-Type: multipart/alternative; boundary=089e011770953f0791053d6fb0ac Subject: Re: [PHP-DEV] Server-Side Request/Response Objects From: ocramius@gmail.com (Marco Pivetta) --089e011770953f0791053d6fb0ac Content-Type: text/plain; charset=UTF-8 Hey Paul, On 26 Sep 2016 21:38, "Paul Jones" wrote: > > Hi all, > > 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. > > * * * > > From time to time we've all heard the complaint that PHP has no built-in request object to represent the execution environment. Userland ends up writing these themselves, and those are usually tied to a specific library collection or framework. The same is true for a response object, to handle the output going back to the web client. I've written them myself more than once, as have others here. > > After doing some library and framework research (linked later) it looks like there is a reasonably common subset of request/response functionality across all the userland implementations. That functionality also appears useful to non-framework users. > > I wrote up a userland implementation for that limited subset of functionality, and John Boehr then used that as a reference point for the C version. It is PHP 7.x only, and you can see the result at: > > > > (The userland reference implementation is at < https://gitlab.com/pmjones/phprequest/tree/master/refimpl>, and the research subjects are in < https://gitlab.com/pmjones/phprequest/tree/master/refimpl/notes>.) > > The extension provides 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. There are only 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 capability > > I thought this might best be offered as a PECL extension first, leading (I would hope) to becoming a part of the PHP distribution later if it proves out. However, PECL has not responded in the past few days (perhaps I have not waited long enough). > > In the mean time, I am bringing it up here to either (1) get PECL's attention, or (2) begin the RFC process if there's enough interest per < https://wiki.php.net/rfc/howto>. > > I'm happy to answer any questions, and undergo any criticism, that you may have regarding this. Thanks for your time and attention. > > > -- > > Paul M. Jones > http://paul-m-jones.com > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > After all the effort put into getting PSR-7 working (and now adopted, which seems to be happening quite quickly), and the previous Symfony\HttpFoundation, having yet another API seems like three step s backwards to me. --089e011770953f0791053d6fb0ac--