Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108581 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 62708 invoked from network); 14 Feb 2020 17:32:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Feb 2020 17:32:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A903D1804F8 for ; Fri, 14 Feb 2020 07:47:30 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29169 217.70.176.0/20 X-Spam-Virus: No X-Envelope-From: Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 14 Feb 2020 07:47:29 -0800 (PST) X-Originating-IP: 107.223.28.39 Received: from samurai.attlocal.net (107-223-28-39.lightspeed.nsvltn.sbcglobal.net [107.223.28.39]) (Authenticated sender: pmjones@pmjones.io) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 2B4E91C000D; Fri, 14 Feb 2020 15:47:26 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) In-Reply-To: <5904137.fSVIMsojiJ@mcmic-probook> Date: Fri, 14 Feb 2020 09:47:25 -0600 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <50BD013E-CF72-414C-BBC0-A7A2E45CBDDB@pmjones.io> <5904137.fSVIMsojiJ@mcmic-probook> To: =?utf-8?Q?C=C3=B4me_Chilliet?= , Niklas Keller X-Mailer: Apple Mail (2.3608.60.0.2.5) Subject: Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2) From: pmjones@pmjones.io ("Paul M. Jones") Hi C=C3=B4me & Niklas, > On Feb 13, 2020, at 04:52, C=C3=B4me Chilliet = wrote: >=20 > Le mercredi 12 f=C3=A9vrier 2020, 19:20:56 CET Niklas Keller a =C3=A9cri= t : >=20 >> Naming >>=20 >> I think we shouldn't take over the naming of the super globals, e.g. >> $_GET really contains the query parameters and has nothing to do with >> GET or POST, so $request->getQueryParameter(...) would be a better >> name. >=20 > I think this remark is really on point. > GET and POST are HTTP methods and not ways of passing data. You can = have query parameters on any request, and you can have POST data with a = lot of other HTTP methods, as is commonly used in REST APIs. Your comments on naming are well-made. While working on the implementation, we tried out $query instead of = $get, on exactly the premise that you state: i.e., that `$_GET` holds = the query parameters, and has nothing to do with the GET method. But in = the end, we settled on mapping more directly from `$_GET` =3D> `$get`, = and `$_POST =3D> $post`. Having said that, we are willing to revisit that naming decision if = there's support for doing so. Perhaps: - rename $get to $query, populating it from `$globals['_GET']`, on the = basis stated above - rename $post to $input, populating it from `$globals['_POST']`, on the = basis that it typically relates to the parsed form of php://input Your (and/or anyone else's) thoughts on that? --=20 Paul M. Jones pmjones@pmjones.io http://paul-m-jones.com Modernizing Legacy Applications in PHP https://leanpub.com/mlaphp Solving the N+1 Problem in PHP https://leanpub.com/sn1php