Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109065 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 77349 invoked from network); 16 Mar 2020 17:42:16 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Mar 2020 17:42:16 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B760D18054B for ; Mon, 16 Mar 2020 09:04:43 -0700 (PDT) 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 relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (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 ; Mon, 16 Mar 2020 09:04:42 -0700 (PDT) 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 relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 55F6F1BF214; Mon, 16 Mar 2020 16:04:35 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) In-Reply-To: <9c8064d1-52cf-c31d-f023-e323b5c2dce5@gmail.com> Date: Mon, 16 Mar 2020 11:04:29 -0500 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <4C35AB9D-277D-41AE-8364-83EC1A782F4C@pmjones.io> References: <50BD013E-CF72-414C-BBC0-A7A2E45CBDDB@pmjones.io> <0B40E6E5-342F-4D81-9CAA-A0C0739A7718@pmjones.io> <102D234E-BC5D-42B2-ABC4-93980C1F76A4@pmjones.io> <9c8064d1-52cf-c31d-f023-e323b5c2dce5@gmail.com> To: Rowan Tommins 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 all, > On Mar 14, 2020, at 10:18, Rowan Tommins = wrote: >=20 >> On 13/03/2020 20:36, Larry Garfield wrote: >>=20 >>> * The RFC by design is trying to take the super-globals and make = them OOPy; no more, no less. >>> * The super-globals are not based on HTTP. They're based on CGI, = which is sort of but not quite an HTTP request. >>> * So... call it CgiRequest/CGIRequest? (I am also ignoring = capitalization.) Because that's what it is: It's CGI request data = wrapped up into an object, no more, no less. >=20 > This makes a lot of sense to me. I too find this appealing. That prefix would net these class names: - CgiRequest - CgiResponse - CgiResponseSender The only confusion I think might arise is a consumer saying, "I'm not = using CGI, I'm using (fcgi|apache|etc)". Turning it over in my mind, I wonder if maybe a `Sapi` prefix would be a = better alternative along this path, especially since these objects = relate to the "interface between web server and PHP." = A `Sapi` = prefix would net us: - SapiRequest - SapiResponse - SapiResponseSender The only obvious objection is that the SAPI list includes 'cli'. While = it not strictly outside the realm of the RFC, it certainly is not the = focus; but then, tests running at the command line will be under the = 'cli' SAPI, so there's at least some sort of rationalization for it. Overall, I think `Sapi` looks better than `Cgi`, and certainly better = than `Server` or the other names we've considered. Any further thoughts on naming? > I also just realised that it would make sense to rename $_SERVER in = the object, the same way $_GET has become "query" and $_POST has become = "input". Maybe $request->cgi or something? I sympathize with the desire to rename (or even restructure) the = apparent catchall of `$_SERVER`. But I am still reluctant to do so, = especially as no other researched projects use a different name here = (whereas some have replaced `$_GET` with `$query`, etc). Does anyone besides Rowan long for a different property name here? What = are your suggestions, if any? --=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