Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108582 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 65788 invoked from network); 14 Feb 2020 17:48:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Feb 2020 17:48:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7841518053F for ; Fri, 14 Feb 2020 08:03:36 -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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 14 Feb 2020 08:03:36 -0800 (PST) Received: by mail-oi1-f174.google.com with SMTP id l9so9864251oii.5 for ; Fri, 14 Feb 2020 08:03:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Cp+Hq6xACYT9bR/Rd/oZOD5NaBHJdWp6SnzDClFvoN4=; b=CC2Rcwl8CNeDO8W+7Cmi428mRoFAZRhM0jITm4q1Zv/hZD632qnmino0ud2bDo8W4u BXA8SgZe9LeV/zT8l7Da79352d7yqjdpXL5AIdG1ImnVt8UjExPvq69B06nSIU3+sPBh aix4+gX1PSqGjKh3CzqqahhZo2TcTsTyNAZK+NmjjSu+yuwyYwvcndW+UAMYz7z5hnBu IkusoKSZlaLV3NCzmYpjAd5Q9bpmVmndS2Qd99YGJL4vdHJ6NKP8B0blCd9pXvcjLnft 7ixhTHt6U2m3Cs+4JojecuaZhMcI7xBZNRuKRele0HJncg/fJNViSm1exzeuRrXulZTj CZwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Cp+Hq6xACYT9bR/Rd/oZOD5NaBHJdWp6SnzDClFvoN4=; b=iKvPpUREiDNlv+yEFvbeZTV+SKWbPRYiCUBPTjMBOCleQE+qqviaOrh2IkHSru2DJX v4bsIy2RZyVBbofR1eZRDYO/Oc+JCUDT4kzCKTgLsi8VNvU3rBCt8SajU5FvgH4WnQpc kg7Oi83w6zBdxMFeNpzSzgWYQXoPCnxkPYj2SXuQtbCg4EeuZ1W5FOwUXVutI15MSJfv qq/C7Ss5HFT04qTL1oPZjtBDVlgZfWWG9E0yZKpUl4TlxZLeV51aElR4hQ+XjnDHHpUK IRHg3keEDPxLZWtk2WjrMovB9GyE0DeQn5Ok1CvmRbEFJCXnHXQ+uvADWtRcgLOayTjg xGRA== X-Gm-Message-State: APjAAAV05bnoTJ9ajDo+j0BAzBgqR28+hp1z5Zt8Kk3UaaNju4VAf0KK HAlPvxToGpjAPsAMOvTt700e8zc2MTT5yXwNjCdXIV1R X-Google-Smtp-Source: APXvYqxbtX44QQ9R3FhkrIV5evSgR+icJWYjTlPENXTEaufDe1FF8Osexr+qMHEJmW6xWgsS4GYH/Eha4PZysf6heGY= X-Received: by 2002:a05:6808:b15:: with SMTP id s21mr2186724oij.123.1581696215222; Fri, 14 Feb 2020 08:03:35 -0800 (PST) MIME-Version: 1.0 References: <50BD013E-CF72-414C-BBC0-A7A2E45CBDDB@pmjones.io> <5904137.fSVIMsojiJ@mcmic-probook> In-Reply-To: Date: Fri, 14 Feb 2020 17:03:24 +0100 Message-ID: To: "Paul M. Jones" Cc: =?UTF-8?Q?C=C3=B4me_Chilliet?= , Niklas Keller , PHP Internals Content-Type: multipart/alternative; boundary="0000000000000d0ddc059e8b59dc" Subject: Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2) From: benjamin.morel@gmail.com (Benjamin Morel) --0000000000000d0ddc059e8b59dc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > 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? Symfony uses $request->query and $request->request for $_GET and $_POST, respectively. I like $request->query for query params, but always found $request->request for body parameters confusing. I like $request->input a bit better, although I'd be interested to hear more ideas on this one. =E2=80=94 Benjamin On Fri, 14 Feb 2020 at 16:47, Paul M. Jones wrote: > Hi C=C3=B4me & Niklas, > > > On Feb 13, 2020, at 04:52, C=C3=B4me Chilliet < > come.chilliet@fusiondirectory.org> wrote: > > > > Le mercredi 12 f=C3=A9vrier 2020, 19:20:56 CET Niklas Keller a =C3=A9cr= it : > > > >> Naming > >> > >> 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. > > > > I think this remark is really on point. > > GET and POST are HTTP methods and not ways of passing data. You can hav= e > 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? > > > -- > 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --0000000000000d0ddc059e8b59dc--