Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77996 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70900 invoked from network); 14 Oct 2014 13:47:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2014 13:47:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:51561] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9F/79-26074-1792D345 for ; Tue, 14 Oct 2014 09:47:29 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id DC53F2400DC; Tue, 14 Oct 2014 09:47:26 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hKU1dp7BXv4Q; Tue, 14 Oct 2014 09:47:26 -0400 (EDT) Received: from oa-res-26-28.wireless.abdn.ac.uk (oa-res-26-28.wireless.abdn.ac.uk [137.50.26.28]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 9EAE42400D7; Tue, 14 Oct 2014 09:47:25 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: Date: Tue, 14 Oct 2014 14:47:22 +0100 Cc: Andrey Andreev , PHP internals list Content-Transfer-Encoding: quoted-printable Message-ID: <5AA7FAB4-64DB-41C9-A121-08AA29005380@ajf.me> References: <776669CE-9E8C-4069-9834-C7275CCA0EF4@ajf.me> To: Kris Craig X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] New globals for PUT and DELETE From: ajf@ajf.me (Andrea Faulds) 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=92ve 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. >=20 > 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. > 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. We already have a nonsensical system = where $_GET isn=92t about GET, but about query string parameters, and = $_POST isn=92t about POST, but the 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=92s clear it=92s about query string parameters, which any = method can have. Similarly, by using $_BODY, it=92s clear it=92s about = request body parameters, which any method can also have. Sure, all existing code uses $_GET and $_POST and they won=92t go away = any time soon. But we would have saner names that people writing new = code can use. -- Andrea Faulds http://ajf.me/