Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78503 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64183 invoked from network); 31 Oct 2014 09:26:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Oct 2014 09:26:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 198.187.29.244 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.244 imap1-3.ox.privateemail.com Received: from [198.187.29.244] ([198.187.29.244:39918] helo=imap1-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7B/C0-57662-5A553545 for ; Fri, 31 Oct 2014 04:26:00 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 373B6B0008B; Fri, 31 Oct 2014 05:25:54 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id vfaUnkq77AGq; Fri, 31 Oct 2014 05:25:54 -0400 (EDT) Received: from [137.50.174.82] (oa-edu-174-82.wireless.abdn.ac.uk [137.50.174.82]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 7AF40B0008A; Fri, 31 Oct 2014 05:25:53 -0400 (EDT) References: <5452B87B.5040009@garfieldtech.com> Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-ID: <0B797CE3-7AFA-4330-9A98-D3CAFC6D6072@ajf.me> Cc: Larry Garfield , PHP Internals X-Mailer: iPhone Mail (12B411) Date: Fri, 31 Oct 2014 09:25:51 +0000 To: Sherif Ramadan Subject: Re: [PHP-DEV] New Standardized HTTP Interface From: ajf@ajf.me (Andrea Faulds) > On 31 Oct 2014, at 02:54, Sherif Ramadan wrote: >=20 > So far there seems to be a lot of concern around BC, and particularly > removing or getting rid of GPC superglobals. So I completely understand th= e > concerns and hope to address them as clearly as possible. >=20 > First, for the sake of BC I think removing the superglobals from the > language should not be done here. Instead, for performance reasons, I'm > going to propose that the superglobals are not populated at the request > level. This means that the implementation is free to populate them at will= > since they will still exist, but will be initialized to empty arrays by th= e > language. This is no less of a backwards-compatibility headache. This still breaks eve= ry PHP app I have ever written. >=20 > Second, it's a valid concern that's there's no actual proposed interface. > So let me be begin by proposing a rough draft for one. >=20 > So let's consider the following interface layout and some sample > implementations as a start... >=20 > https://gist.github.com/srgoogleguy/f729053e3e88b2d2b3ec >=20 > Then let's consider the kind of flexibility this would allow userland in > terms of filtering, validating, and modifying the request data under > various conditions. Obviously, PHP has to provide some form of default > implementation so some base class HttpRequest can be implemented in PHP an= d > this can be easily extended by userland. >=20 > Also, take into consideration the kind of performance gains you might get > out of this by doing things like lazy-loading or lazy parsing or > lazy-filtering of request data. Filters also need not be applied at the > global level. PHP's default implementation would simply use the input > stream to populate GPC as normal (as it currently does), but I believe > introducing the base class will encourage others to make better use of > request/response handling in their own code. No no, I'm not concerned about the contents of the interface. I'm wondering w= hat, exactly, this "interface" does? I don't see how a mere interface would r= eplace the superglobals, unless you want a superglobal request object that a= nyone can swap out, which sounds like a bad idea. -- Andrea Faulds http://ajf.me/=