Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78521 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12465 invoked from network); 31 Oct 2014 17:17:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Oct 2014 17:17:24 -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 209.85.212.171 as permitted sender) X-PHP-List-Original-Sender: theanomaly.is@gmail.com X-Host-Fingerprint: 209.85.212.171 mail-wi0-f171.google.com Received: from [209.85.212.171] ([209.85.212.171:61975] helo=mail-wi0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F4/56-15608-324C3545 for ; Fri, 31 Oct 2014 12:17:24 -0500 Received: by mail-wi0-f171.google.com with SMTP id q5so1905018wiv.4 for ; Fri, 31 Oct 2014 10:17:20 -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=/yJQu9ySsQgvuMEJj0sn/cs2p9v8WG3SM/4EtrnElsU=; b=gtuI9FgWotYrejWn3OqlQ3ozWWspEl3k/ugf1Y/gv9Gxj0Nx46Wk+HY00XwHPdSXG1 nmanyxdTwkJxqf/rrZTy4VuLKidVZTbgUXAqw2R433VW2TaBZBomuTpE5PoeiTbbLMad Zh43VqPTfz8sW6WczpXNoS3HtDmPMie4e+sLAjvGHs2gvm6I00MPsAP6Qttnf/hKEVLs wLbp35DIrQZcu/Zbp74Op7W7abOiXAIn8xQFpNFbqODygE4U0bcaAUXvO9TipQThxUdM ci/JSJhV+v1x1joxPPFMRZHssDlcI6h9FmjnLshG9oOWS2aroHOV9nLjUVV/qiooEOdt wn4Q== MIME-Version: 1.0 X-Received: by 10.180.14.231 with SMTP id s7mr5440872wic.0.1414775840231; Fri, 31 Oct 2014 10:17:20 -0700 (PDT) Received: by 10.216.123.4 with HTTP; Fri, 31 Oct 2014 10:17:20 -0700 (PDT) In-Reply-To: <8AA031AF-6A31-4B71-8DCF-A334B384F4EC@ajf.me> References: <8AA031AF-6A31-4B71-8DCF-A334B384F4EC@ajf.me> Date: Fri, 31 Oct 2014 13:17:20 -0400 Message-ID: To: Andrea Faulds Cc: PHP Internals Content-Type: multipart/alternative; boundary=f46d040fa00464d68b0506bb2b19 Subject: Re: [PHP-DEV] New Standardized HTTP Interface From: theanomaly.is@gmail.com (Sherif Ramadan) --f46d040fa00464d68b0506bb2b19 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Oct 31, 2014 at 12:19 PM, Andrea Faulds wrote: > > > > I=E2=80=99m not sure I really see what it solves, though? Why should we a= llow > users to implement their own slow parsers in userland? Why can=E2=80=99t = we just > have a single built-in parser like we=E2=80=99ve had the last two decades= ? I don=E2=80=99t > see the point. > > For one, it would solve the problem addressed by the bug report ( http://php.net/55815) listed in the RFC, where users are asking for additional features to parse and handle different kinds of requests like PUT, which PHP currently doesn't do. Additionally, it solves problems such as filtering input from the request with a more abstract interface that doesn't rely on modifying or copying globals. The implementation can be devised to do filtering at the request level or even lazy-loaded so that filters are only applied when the data is requested. In addition, you could utilize this approach to apply different kinds of custom filters based on the request type using the onReceive hook, for example. Further more it can be used to ensure that the request data is immutable so that there is no wonder if the superglobals have been modified/tainted. This is something many frameworks try to abstract themselves in fear that someone might accidentally modify the superglobal variables (as this is very easy to do in userland). --f46d040fa00464d68b0506bb2b19--