Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96156 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82970 invoked from network); 26 Sep 2016 19:37:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Sep 2016 19:37:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=pmjones88@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pmjones88@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.180 as permitted sender) X-PHP-List-Original-Sender: pmjones88@gmail.com X-Host-Fingerprint: 209.85.161.180 mail-yw0-f180.google.com Received: from [209.85.161.180] ([209.85.161.180:36792] helo=mail-yw0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id ED/C1-04248-F0979E75 for ; Mon, 26 Sep 2016 15:37:52 -0400 Received: by mail-yw0-f180.google.com with SMTP id t67so164466086ywg.3 for ; Mon, 26 Sep 2016 12:37:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-transfer-encoding:subject:message-id:date:to :mime-version; bh=VYrLV6Q+i+n/wl9XLQKclVcJ8Bo7hO6Zp7A3AQLUCWc=; b=CT9nLZ6XjTm7h61DMSKSoB3MRT7/uQ6LWhPUXadqIUHb4UG7EKj0+gCtJyWIz0nNm6 ebS9ukVnuMrcfiLkoPgYMSLtbuZ4pSwlhbZ/+qw7wi1ZCiB5Z9hpnDzqrQoqCDzjOoLB SnMcOkhPtDsxspcZFk2DPkZOUB/QzPDldQnvOkOWy5eTGZGqDKeiW+f/qbLSNDLkUik4 +9wUoX6cCheHwQ31OtB5woT/fPHQZ6t+JO5O2JYeVzU+Zy7SXjyG2MSLgPLKDuTE7bCq KluyKZFzZ1lUTPGC4179n8Zb4aT2T08rTX9s0r9D2GN6JF1q0fE6ppjm9nI05QV9umkE EYCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-transfer-encoding:subject :message-id:date:to:mime-version; bh=VYrLV6Q+i+n/wl9XLQKclVcJ8Bo7hO6Zp7A3AQLUCWc=; b=bb0xd8WodSSyokBiolgre9YY8W/3Ofv5i47hcY/TiP8CQyxkr05eTQuEZO41IYu4gQ 0Gx46vKKEv/gl7Nnlb5Chno+ot240tF4PP22kNTmBmhd0H8fKJn3B/jlhSWp0tLRofym /fGoaQRvavOUFWEIFNKdvGi4RDXfSTu2V/7ogS4yD3Q8OBvaWAH6ISK695LF+1Wl0urm GUXmnCt2CWsDeXf2I2I2eFgn912EfJz+Ekw5HyvraBHcJaCHXVP2DB8PmVFQ1Bay9URk 7S4uQAGtrjyZwHR7Qzgo85TzUl0ftZVYjYUiwKl6kbYyqR2rAfi63iR1IWHR9bXXSKoK V+xQ== X-Gm-Message-State: AE9vXwNS/J0f5kCtiY1fOcTxGf+Jp3th7Ke6vHnIkZd/gDfEyVgIpz/u7pdH5+P18OaPaQ== X-Received: by 10.13.206.134 with SMTP id q128mr17830668ywd.270.1474918668584; Mon, 26 Sep 2016 12:37:48 -0700 (PDT) Received: from ?IPv6:2602:306:cecb:ae30:203a:56bd:2a72:2da4? ([2602:306:cecb:ae30:203a:56bd:2a72:2da4]) by smtp.gmail.com with ESMTPSA id i5sm9469862ywg.54.2016.09.26.12.37.48 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Sep 2016 12:37:48 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-ID: Date: Mon, 26 Sep 2016 14:37:47 -0500 To: PHP internals Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) Subject: Server-Side Request/Response Objects From: pmjones88@gmail.com (Paul Jones) 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. * * * =46rom 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 = , and the = research subjects are in = .) 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 = . I'm happy to answer any questions, and undergo any criticism, that you = may have regarding this. Thanks for your time and attention. --=20 Paul M. Jones http://paul-m-jones.com