Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69444 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94040 invoked from network); 2 Oct 2013 09:58:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Oct 2013 09:58:09 -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.196 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.196 imap4.ox.registrar-servers.com Received: from [192.64.116.196] ([192.64.116.196:32883] helo=imap4.ox.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 94/F0-23255-03EEB425 for ; Wed, 02 Oct 2013 05:58:09 -0400 Received: from localhost (localhost [127.0.0.1]) by oxmail.registrar-servers.com (Postfix) with ESMTP id 43FBB560071 for ; Wed, 2 Oct 2013 05:58:06 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap4.ox.registrar-servers.com Received: from oxmail.registrar-servers.com ([127.0.0.1]) by localhost (imap4.ox.registrar-servers.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id OzxSP4gq3-Y8 for ; Wed, 2 Oct 2013 05:58:06 -0400 (EDT) Received: from app2.ox.registrar-servers.com (unknown [198.187.29.232]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id 23F4456006A for ; Wed, 2 Oct 2013 05:58:06 -0400 (EDT) Date: Wed, 2 Oct 2013 10:58:06 +0100 (BST) Reply-To: Andrea Faulds To: PHP Internals Message-ID: <1463242957.26490.1380707886136.open-xchange@oxwebmail.registrar-servers.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.4.0-Rev11 Subject: Re: [PHP-DEV] HTTP supergloblas and request body/query (was: Parsing PUT data) From: ajf@ajf.me (Andrea Faulds) > Le 2 octobre 2013 =C3=A0 07:59, Michael Wallner a =C3=A9cr= it : > > Since ever people are confused by _GET and _POST superglobals, > because, despite their name, they do not (really) depend on the > request method.=C2=A0 Therefor I propose to phase out $_GET and name it > $_QUERY and I propose to phase out $_POST and name it $_FORM (I'm not > 100% confident with the latter yet, though). > Backwards compatibility matters, so we should keep $_GET and $_POST but add these as better aliases for them. =C2=A0 While we're at it, can we remove the quirk that existed due to register_glo= bals where periods and such are replaced with underscores? Such that for /test.php?php.pecl=3D3&php_pecl=3D4 we'd still only have $_GET['php_pecl'] = =3D=3D=3D 4 but there would also be $_QUERY['php.pecl'] =3D=3D=3D 3 and $_QUERY['php_pecl']= =3D=3D=3D 4, if you get where I'm coming from. > Further, I propose to remove the POST method restriction for handling > request bodies and solely rely on the content type to trigger the > parser(s). (*) +1 to this, current behaviour is nonsensical. > There are already parsers for application/x-www-form-urlencoded and > multipart/form-data in the core.=C2=A0 One could think of providing an AP= I > to add content type handlers from extensions, ext/json may be an > example, like it is hacked into pecl_http-v2. +1 Handling JSON would be pretty neat. Maybe we could even support it by de= fault (after all, there is the json ext), so long as getting the unparsed request= body isn't impeded by that. -- Andrea Faulds http://ajf.me/