Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78003 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82799 invoked from network); 14 Oct 2014 13:57:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2014 13:57:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.42 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 209.85.218.42 mail-oi0-f42.google.com Received: from [209.85.218.42] ([209.85.218.42:33065] helo=mail-oi0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 39/4C-26074-ADB2D345 for ; Tue, 14 Oct 2014 09:57:47 -0400 Received: by mail-oi0-f42.google.com with SMTP id a141so16700382oig.29 for ; Tue, 14 Oct 2014 06:57:44 -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=Pyws5/eEM6w/q9Hb5wuOXrxl1Jy+dRuSzBjQvzJu8zM=; b=cpvekMhXxuuOwm21m4sD1N58zl2bFhUJ6U0b1ntDJffMC4xd5HslYfoSeHkc5BMGox uSzPIwH18bpCsosdn66KktrJiFXnwSdgoROO5YnLm5ZjfxnT1M8zXIU56wFzYoERlzfP gF/M+dbOaCkPgfMCrtWMmuE8dJCwPqLjJWY4PDOd2dIS6MfuJY9XC3a+M7Vmal7aMMS1 2FIL9mNv7cOw3UXwfYz2UYy5Rhe48dTUZICvBbGJjOyvqBHoVOkcVz2dmMHJjkuYkNX7 E/MFNZK2H37RQCjmVNBH4/CjWdu1/2QUq+5VP7Qt+uRKI4IFj4dXeU1QKDRQqxyI+lu/ DnSQ== MIME-Version: 1.0 X-Received: by 10.60.62.205 with SMTP id a13mr787079oes.68.1413295064713; Tue, 14 Oct 2014 06:57:44 -0700 (PDT) Received: by 10.202.169.201 with HTTP; Tue, 14 Oct 2014 06:57:44 -0700 (PDT) In-Reply-To: References: <776669CE-9E8C-4069-9834-C7275CCA0EF4@ajf.me> <8CB055D4-F164-4DF3-B019-684BAE7E016E@ajf.me> Date: Tue, 14 Oct 2014 06:57:44 -0700 Message-ID: To: Chris Wright Cc: Mike Dugan , Andrea Faulds , Kristopher , PHP internals list , Andrey Andreev Content-Type: multipart/alternative; boundary=047d7b67682c4b8fb90505626652 Subject: Re: [PHP-DEV] New globals for PUT and DELETE From: kris.craig@gmail.com (Kris Craig) --047d7b67682c4b8fb90505626652 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Oct 14, 2014 at 6:50 AM, Chris Wright wrote: > On 14 October 2014 14:46, Kris Craig wrote: > > On Tue, Oct 14, 2014 at 6:41 AM, Mike Dugan wrote: > > > >> > >> On October 14, 2014 at 9:31:15 AM, Andrea Faulds (ajf@ajf.me) wrote: > >> > >> > >> On 14 Oct 2014, at 14:27, Kristopher > wrote: > >> > >> > $_HTTP_REQUEST_BODY and $_HTTP_QUERY_STRING for nostalgia's sake. > >> > >> Ew, non-superglobals. > >> > >> But $_REQUEST_BODY and $_QUERY_STRING are a bit lengthy. Perhaps $_QUE= RY > >> (for $_GET) and $_BODY (for $_POST)? Then the variable set finally mak= es > >> sense, but isn=E2=80=99t too long: > >> > >> * $_QUERY - query string parameters > >> * $_BODY - request body parameters > >> * $_REQUEST - query string and request body parameters > >> > >> Makes more sense than $_GET and $_POST. > >> > >> Any objections? > >> > >> -- > >> Andrea Faulds > >> http://ajf.me/ > >> > >> > >> +1 for this. This would hopefully also eliminate the confusion for new > >> developers (or not-so-new developers) who don=E2=80=99t quite understa= nd that > $_GET > >> and $_POST don=E2=80=99t strictly relate to their HTTP verbs of the sa= me name. > >> > >> -- > >> > >> Mike Dugan > >> > >> mike@mjdugan.com > >> > > > > That could work, though the BC breakage will be extreme. I'm not sure = if > > that's worth it even in a major version increment. On the other hand, > > making $_PUT and $_DELETE available wouldn't break anything and wouldn'= t > > require re-training for devs. > > ...but is also the wrong solution. It's not scalable, How is it not scalable, exactly? It's just a couple aliases. > and the only > sensible way to implement them would be as aliases of $_POST, because > they would contain the same data. How does this fundamentally differ > from $_BODY (or whatever)? > It's not supposed to functionally differ. It's supposed to create some better consistency and make it easier for devs to differentiate between different REST methods when retrieving data. If REQUEST_METHOD is PUT, then I can set the parsed params to the value of $_PUT. The aliases match the methods used, making the code that much more readable and scalable. --Kris --047d7b67682c4b8fb90505626652--