Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78000 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77322 invoked from network); 14 Oct 2014 13:52:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2014 13:52:11 -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.53 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 209.85.218.53 mail-oi0-f53.google.com Received: from [209.85.218.53] ([209.85.218.53:64315] helo=mail-oi0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/FA-26074-A8A2D345 for ; Tue, 14 Oct 2014 09:52:11 -0400 Received: by mail-oi0-f53.google.com with SMTP id v63so16418580oia.40 for ; Tue, 14 Oct 2014 06:52:08 -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=VrB804V78BmG69Vl90kR0mt5eYBr7sIrC9POC0WLANQ=; b=m2TvLgvLAxKBhIyrzQtffOl3hYIPAlw3cS+K68OsbQX+2ndOQkxVM0WRvOFfSBg8gx I3SNNVGPBt/4Uvn5ySyY3+6lr9Atjh24NSOIjwDV2Ma+Qymswha46bZki9Dvi+/DIp9k /DwbhffHC0Yw6e9ILXLnCGa7ibzptSmfjLNfC1yM5XimJat2Bp682RrRU9/G0VMlTZh4 NBfXJ9gHo2rkefzxadGetUc6381JW895zokyr2vnMwo613lX0kiDmtQ+FxBc9yE91Qh5 wVobyKLh4ZwlTHwCmPc2GhPEWpukMezoDl/d7rJ2NKPKhtnNeiecv4AcdiE79isOBwmB clLw== MIME-Version: 1.0 X-Received: by 10.60.16.2 with SMTP id b2mr202341oed.82.1413294728755; Tue, 14 Oct 2014 06:52:08 -0700 (PDT) Received: by 10.202.169.201 with HTTP; Tue, 14 Oct 2014 06:52:08 -0700 (PDT) In-Reply-To: <5AA7FAB4-64DB-41C9-A121-08AA29005380@ajf.me> References: <776669CE-9E8C-4069-9834-C7275CCA0EF4@ajf.me> <5AA7FAB4-64DB-41C9-A121-08AA29005380@ajf.me> Date: Tue, 14 Oct 2014 06:52:08 -0700 Message-ID: To: Andrea Faulds Cc: Andrey Andreev , PHP internals list Content-Type: multipart/alternative; boundary=089e0153815e45415f050562523f Subject: Re: [PHP-DEV] New globals for PUT and DELETE From: kris.craig@gmail.com (Kris Craig) --089e0153815e45415f050562523f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Oct 14, 2014 at 6:47 AM, Andrea Faulds wrote: > > On 14 Oct 2014, at 14:42, Kris Craig wrote: > > > I don't think that would be a good idea, either. They require more > typing > > and it'd probably be a lot easier for devs to remember which one means > GET > > and which one means POST. > > I=E2=80=99ve already proposed the shorter $_QUERY and $_BODY. > > > PHP is supposed to be KISS, right? Well, the current reliance on > > php://input for two methods but not the other two invites confusion. > That > > makes it less-than simple, I believe. > > > > Removing or renaming $_GET and $_POST would also create confusion and > > almost certainly cause widespread BC breakage on a pretty massive scale= . > > I never said anything about removing $_GET or $_POST. I suggested adding > saner aliases. > Ok, that was my bad. I misinterpreted. > > > And there's really no gain to offset that. So that just leaves us with > > either continuing to have two REST methods but not the others or add a > > $_PUT and a $_DELETE, even if they just alias to php://input again. > > Adding $_PUT and $_DELETE is silly. No more silly than $_GET and $_POST are now. But either way, we should try to make things consistent. This inconsistency only serves to invite confusion. > We already have a nonsensical system where $_GET isn=E2=80=99t about GET,= but > about query string parameters, and $_POST isn=E2=80=99t about POST, but t= he request > body. We should create sane aliases ($_QUERY and $_BODY) and extend > $_POST/$_BODY to support request bodies from any method. > > This would make things actually simpler, and less confusing, as we stop > pretending $_GET is about GET and $_POST is about POST. By using $_QUERY, > it=E2=80=99s clear it=E2=80=99s about query string parameters, which any = method can have. > Similarly, by using $_BODY, it=E2=80=99s clear it=E2=80=99s about request= body parameters, > which any method can also have. > That's a good point. Unfortunately, $_GET and $_POST aren't going away anytime soon. And in the meantime, we should at least have $_PUT and $_DELETE alias to $_POST so devs have the option of using them. > Sure, all existing code uses $_GET and $_POST and they won=E2=80=99t go a= way any > time soon. But we would have saner names that people writing new code can > use. > > -- > Andrea Faulds > http://ajf.me/ > > > > > --089e0153815e45415f050562523f--