Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96157 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87420 invoked from network); 26 Sep 2016 21:11:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Sep 2016 21:11:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=korvinszanto@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=korvinszanto@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.46 as permitted sender) X-PHP-List-Original-Sender: korvinszanto@gmail.com X-Host-Fingerprint: 209.85.218.46 mail-oi0-f46.google.com Received: from [209.85.218.46] ([209.85.218.46:32941] helo=mail-oi0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/52-04248-6EE89E75 for ; Mon, 26 Sep 2016 17:11:03 -0400 Received: by mail-oi0-f46.google.com with SMTP id r126so222353986oib.0 for ; Mon, 26 Sep 2016 14:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=60yBciqwHgZOiDhKpiMLY6klPuflPDx8yeXMOpkQZvY=; b=OBI9s1lctj6RBBBTXzTllNkggW343KxMPbcmG0UAldTpRVM7ygnslH9lZsg/pmTd0n 8hqJktiHYewfgWt1mtIlB52k+yQe4rbWC4kMw/j/uGBMsrScuk6F9KmGlEiBipdIzd1O 2maX3/osVrWmKi5EAqQ4hZlIGTVmgbt4O9FwKTW7Q6mTxQN3P5dmniW/rPjNOzdb6PIO 8qaKMdiy9hiNtPp9mZLi5uG1psGIzV0NUClRPEs3Xvt77smNp8E+I6fpXKD6fEqHi86v B6oaIMv/7MxnMm7B2CPKJclv8NKHOFAO9YeuiFqrrX2ERfr4G8HdsBIrJUXKuoZEslmJ Mh1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=60yBciqwHgZOiDhKpiMLY6klPuflPDx8yeXMOpkQZvY=; b=HJ9J6f6+o96+LgByBx3yDe7+8jansP4BbbAm3ghEjQaKyW0366eVR5k844QBG/kpfJ 03K8yDLPuFLuPeS0zkbzjkr1Hd+agbBn9hUpNdXz7EREiwq572aDYsZU/PJl/uiiR9lO zCVcnHkcqvvZfwelaU5aHJoShsoCsRclbkdR/a7cgpI50xnTGiLchQB/rJCOI73CqIxX BXXiw0zDIhwWnaHBd3J6ghLvZOpD4HTJxDV8eN0dDQU/X6uS1fjejsc309C6hoWqi6UW yga7l06r2DqlOBWPXvLtnoJRBPV6W6dqiM9Qa3XwRQ5mJppzm7RX3vWr1Y6isrAsAqcw XV6A== X-Gm-Message-State: AA6/9RksM8sbtlJEOafJNa69pRLoT1Ov0YyY1zNmSTNdXe5VX7p355pgCNXKQer8lbZ5pU/kI79+x0CN7J5vYw== X-Received: by 10.202.96.133 with SMTP id u127mr3598487oib.165.1474924260075; Mon, 26 Sep 2016 14:11:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 26 Sep 2016 21:10:49 +0000 Message-ID: To: Paul Jones , PHP internals Content-Type: multipart/alternative; boundary=001a113d5d0e97b988053d6f900a Subject: Re: [PHP-DEV] Server-Side Request/Response Objects From: korvinszanto@gmail.com (Korvin Szanto) --001a113d5d0e97b988053d6f900a Content-Type: text/plain; charset=UTF-8 Hi Paul, Thank you for spending the time to actually put this together! I've been dipping my toes in the water asking around about this (sort of) as well and feedback so far has been "That sounds great but I don't think there is enough interest." So I'm very interested to see what kind of response this gets here. Personally I would prefer complete HTTP message objects similar to existing PSR-7 implementations be added perhaps alongside these simple classes you've proposed. Thanks, Korvin On Mon, Sep 26, 2016 at 12:38 PM 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 > > --001a113d5d0e97b988053d6f900a--