Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108591 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 82575 invoked from network); 15 Feb 2020 09:47:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Feb 2020 09:47:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9FD3F18050A for ; Sat, 15 Feb 2020 00:02:21 -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,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS11403 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (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 ; Sat, 15 Feb 2020 00:02:20 -0800 (PST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 57D4421E1C for ; Sat, 15 Feb 2020 03:02:20 -0500 (EST) Received: from imap26 ([10.202.2.76]) by compute7.internal (MEProxy); Sat, 15 Feb 2020 03:02:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=JadWZ3rJtWuznCGBuqKaGBP3UjmzjMHqvCqK6w8GX 68=; b=R40ZmAjQxFaLNTX+WInLY2pRKqAFomXcOCBLusaeZx4UUQGA+AOSCbdHB P3cjZKiEbHHw78KrbZ2kZ5WIlcIJMPA/j+cdADv2Q/UvWlvvuAy7hFHOk3HJCRAF Wab/SzzPHL9Bnc0HQPbq0awbih9SSz+fltXgWePV6uEV4luQsHfW6j6hXW06UJ9M tj40n0qEW+XxD2Jnn+neYPHdMwatk1Q28Yr1Bbr79YU5H2N47yPNGZoNeyZStyft FNCMqVWbdAmWPW4bZM2YXfHTFUQaViMfqZ2YGP7HNWNCzdWORlDdfIBXZfsEKlMD 3Ba9Bob1yEMF6HCCcuc2TkChWdFUw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjedugdduudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuffhomhgrihhnpehphhhpqdhfihhgrdhorhhgnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguth gvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 1E5DD14200A2; Sat, 15 Feb 2020 03:02:20 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-802-g7a41c81-fmstable-20200203v1 Mime-Version: 1.0 Message-ID: In-Reply-To: References: <50BD013E-CF72-414C-BBC0-A7A2E45CBDDB@pmjones.io> <5904137.fSVIMsojiJ@mcmic-probook> Date: Sat, 15 Feb 2020 02:01:59 -0600 To: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2) From: larry@garfieldtech.com ("Larry Garfield") On Fri, Feb 14, 2020, at 10:47 AM, Benjamin Morel wrote: > > > > What about $query and $body? That would be closer to the terminology= > > used in HTTP RFCs. >=20 >=20 >=20 > The problem is that $body is typically used to get the raw message bod= y as > a string or stream. > I was thinking more something along the lines of $bodyParams, which is= more > verbose but leaves no ambiguity: *$queryParams* and *$bodyParams*. >=20 > =E2=80=94 Benjamin Data point: In PSR-7, the names used are: - queryParams: The query string values. - parsedBody: The body of the message, converted to a meaningful value. = If the request type is a form, then it MUST be equivalent to $_POST. If= not, it's up to the particular implementation to determine what "parsed= " means. (Eg, parsing a JSON body of a POST into some domain object, or= whatever.) - The raw body is a stream called "body", or rather an OOP wrapper aroun= d a stream since PHP's native stream interface is fugly. - There's specific handling for uploadedFiles, too. cf: https://www.php-fig.org/psr/psr-7/ To the earlier point about existing implementations, while there are a m= yriad of older, custom implementations of abstractions around supergloba= ls, there's only two that are not decade-old proprietary implementations= : HttpFoundation and PSR-7. Those are, realistically, the only implemen= tations that matter. Anything else would be on the same order of magnit= ude effort to port to one of those as to port to this proposal. In a me= aningful sense, those are the only "existing competition". Both also ha= ve robust ecosystems that make leveraging them in an entirely custom app= pretty straightforward. (Whatever your feelings of the technical merits of either design, that's= the current state-of-the-market.) Which therefore begs the question, is this proposal intended to supplant= HttpFoundation and PSR-7, or to become a common underpinning that both = of them wrap, or to be a third cohabitating implementation in the ecosys= tem? It doesn't seem robust enough to supplant both of them entirely, there's= little value to either HttpFoundation or PSR-7 to rewrite their guts to= wrap this object (though it's easier for PSR-7, as an interface, for so= meone to write a new implementation of it than for HttpFoundation), whic= h would mean we'd end up with a 3rd in-the-wild implementation for user = space to keep track of. I am unclear how that is a market win. PDO was mentioned previously as a model. Yes, there were many user-spac= e implementations prior to PDO. PDO effectively supplanted and obsolete= d them. However... PDO was also never thought-through enough or robust = enough to be used directly, spawning a whole new ecosystem of PDO++ libr= aries that people actually use (Doctrine, Eloquent, Drupal's DBTNG, Aura= .sql, to name but a few). So, not the full win people were hoping for. = If that pattern holds, we'd end up with... a new generation of this-RFC= ++ wrappers that still abstract it away yet aren't compatible with each = other. That said, PDO did have the advantage of at least partially unifying dis= parate SQL APIs. There really aren't multiple incompatible HTTPs to abs= tract over the way there is for SQL backends, so the analogy is somewhat= weak either way. --Larry Garfield