Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78522 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14028 invoked from network); 31 Oct 2014 17:24:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Oct 2014 17:24:34 -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.176 as permitted sender) X-PHP-List-Original-Sender: theanomaly.is@gmail.com X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:40696] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/A6-15608-FC5C3545 for ; Fri, 31 Oct 2014 12:24:33 -0500 Received: by mail-wi0-f176.google.com with SMTP id h11so1915672wiw.9 for ; Fri, 31 Oct 2014 10:24:29 -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=HycVWYyKeq+bKgwwdSL40IPflFXNcR0oeGqi7JcBv68=; b=dNUtoGObxyOztymih9F0swEdT2VXNgR6BxLM56KxRGLzcQSTg34A/Dj+cb8at0+PZy 5GuIKH+3AzkpmsaxdCwo6wGXfzt5Vof4RjXeEZTtGXOPCB4yYYFD2+zuEGzI1dASUU/N lps8+abpCChieh6qJKjQzNxKiLVS5ZgO/TibmIpSTz0I7gP46NSXHYd9bkEEc1q/cmkj Js6un2+cISQDt2b2+6Vs0+bMeRAYFR550PDP1AbW6J5kRXh2vdCuUU91qgTqxCOzwRkK y3bDTDmhgGbfffJcFHQzqusUvArahk2JVcpDX1LaN4XlfgvDMTRZsjpM6yBDMPiuI50Y lVLQ== MIME-Version: 1.0 X-Received: by 10.194.119.193 with SMTP id kw1mr29679906wjb.37.1414776267914; Fri, 31 Oct 2014 10:24:27 -0700 (PDT) Received: by 10.216.123.4 with HTTP; Fri, 31 Oct 2014 10:24:27 -0700 (PDT) In-Reply-To: <5EFB26B9-E8C0-4F99-93D2-85A9FA4B674D@ajf.me> References: <5452B87B.5040009@garfieldtech.com> <0B797CE3-7AFA-4330-9A98-D3CAFC6D6072@ajf.me> <5EFB26B9-E8C0-4F99-93D2-85A9FA4B674D@ajf.me> Date: Fri, 31 Oct 2014 13:24:27 -0400 Message-ID: To: Andrea Faulds Cc: Larry Garfield , PHP Internals Content-Type: multipart/alternative; boundary=089e01228626e2c48d0506bb441c Subject: Re: [PHP-DEV] New Standardized HTTP Interface From: theanomaly.is@gmail.com (Sherif Ramadan) --089e01228626e2c48d0506bb441c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Oct 31, 2014 at 12:04 PM, Andrea Faulds wrote: > > > > So there=E2=80=99s still a default implementation, then? So, if you want = to parse > in userland, how does that work? The default implementation fills in the > variables and then your implementation parses it again, wasting CPU time > and making the request take longer? Or does the default implementation do > nothing at all unless asked to, breaking existing apps unless they=E2=80= =99re > modified to request parsing? Or is it INI-determined?? > No, by overriding the parseBody or parseParameters methods, for example, you can prevent the default behavior from happening. (i.e. it is not doing the same thing twice). Simply by extending the HttpRequest class, we can call on the child class instead. Any methods not implemented in the extending class would be forwarded to the parent class as per normal PHP inheritance rules. > > > OK. So they=E2=80=99re just interfaces, then? In which case, why not leav= e the > PHP-FIG to finish its HTTP Message proposal instead? > > > *snip* > So, all you=E2=80=99re proposing is a set of interfaces, to compete with = the work > the PHP-FIG is doing. > > I don=E2=80=99t see how this is useful. How, exactly, does adding interfa= ces solve > the problems with superglobals? Because you=E2=80=99re creating a common = standard > for alternative request implementations? But, we already have such a WIP > standard in userland from the PSR people. > > I really don=E2=80=99t get this RFC. If this was to add implementations o= f the PSR > Request/Response stuff, that might be useful. But merely adding new > interfaces=E2=80=A6 I don=E2=80=99t get it. Why duplicate effort? How doe= s this fix > superglobals? > > Competing ideas are good and the very reason that drives innovation. This proposal is for both the interface and the implementing class, which can be extended to create custom behavior in handling the HTTP request/response. I have no idea why you think PHP-FIG or PSR is involved in this conversation. This is a PHP internals matter and should be considered for PHP internals purposes. The benefits and cons of this proposal are pretty clear, I think. You get the ability to handle different kinds of requests as you see fit or you leave the default behavior intact and everyone wins. The only thing you don't get if you do this in userland instead, is you have to do the parsing of the message twice, which this RFC attempts to circumvent, but offering a way to overrride the parser before parsing takes place (if you choose to implement it). --089e01228626e2c48d0506bb441c--