Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78499 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40267 invoked from network); 31 Oct 2014 02:54:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Oct 2014 02:54:10 -0000 Authentication-Results: pb1.pair.com header.from=theanomaly.is@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=theanomaly.is@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.44 as permitted sender) X-PHP-List-Original-Sender: theanomaly.is@gmail.com X-Host-Fingerprint: 74.125.82.44 mail-wg0-f44.google.com Received: from [74.125.82.44] ([74.125.82.44:43774] helo=mail-wg0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/83-17925-0D9F2545 for ; Thu, 30 Oct 2014 21:54:09 -0500 Received: by mail-wg0-f44.google.com with SMTP id x12so5062409wgg.31 for ; Thu, 30 Oct 2014 19:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=VSRny/Tvm4oVoscoC9XNrKrOQVsRO0Dvpw7cs1/A410=; b=HcFbPGv5IFRL2rKUMi2eAagkAfwrbHH1Kv0hqDKcHcLJDgjOV3BA8mAfSeVICyMD/i 271ziMcnWjKFH6yKbz5+wZgqhJuU92PimOJslRpRi9CpuCY3bo7UfRa5Eda9Pt8In210 5/D0b2y8gIxTApI9kVF30nnYHqt3R5LMxW2yfiCVr/WqxLiwk4esw85MZytsunGyZth+ iZR/5m7p3qOlvB4fbPI6jJJAv/c9FCffq0YCJmUr6I/PiqOFXEOrpj4hcmGTIS5eBK5m QCcjG+zs1ujgeT4NiVSZcMhrlQZTDpczKsICxovmqVKiRXd+rw+DpI+LH6XzQPv7WnQ2 H7tg== MIME-Version: 1.0 X-Received: by 10.180.98.170 with SMTP id ej10mr734832wib.17.1414724045931; Thu, 30 Oct 2014 19:54:05 -0700 (PDT) Received: by 10.216.123.4 with HTTP; Thu, 30 Oct 2014 19:54:05 -0700 (PDT) In-Reply-To: <5452B87B.5040009@garfieldtech.com> References: <5452B87B.5040009@garfieldtech.com> Date: Thu, 30 Oct 2014 22:54:05 -0400 Message-ID: To: Larry Garfield Cc: PHP Internals Content-Type: multipart/alternative; boundary=f46d0442888836889a0506af1cf3 Subject: Re: [PHP-DEV] New Standardized HTTP Interface From: theanomaly.is@gmail.com (Sherif Ramadan) --f46d0442888836889a0506af1cf3 Content-Type: text/plain; charset=UTF-8 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 the concerns and hope to address them as clearly as possible. 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 the language. 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. So let's consider the following interface layout and some sample implementations as a start... https://gist.github.com/srgoogleguy/f729053e3e88b2d2b3ec 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 and this can be easily extended by userland. 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. --f46d0442888836889a0506af1cf3--