Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108779 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 21470 invoked from network); 27 Feb 2020 04:25:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Feb 2020 04:25:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 81D921801FD for ; Wed, 26 Feb 2020 18:43:28 -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 ; Wed, 26 Feb 2020 18:43:27 -0800 (PST) X-Originating-IP: 107.223.28.39 Received: from [192.168.1.85] (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 1FE451C0005; Thu, 27 Feb 2020 02:43:24 +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: Date: Wed, 26 Feb 2020 20:43:21 -0600 Cc: php internals Content-Transfer-Encoding: quoted-printable Message-ID: <27F45990-E3AE-4A77-85EC-A2CA1EAC73E4@pmjones.io> References: <50BD013E-CF72-414C-BBC0-A7A2E45CBDDB@pmjones.io> <5904137.fSVIMsojiJ@mcmic-probook> <3DDBFBA4-8D3A-46C5-9A10-B093A5E2386B@pmjones.io> <54493258-B52E-442A-A11D-82E1D4C7DE5E@gmail.com> <8264F6CF-AD55-41E2-9F5A-DAE8942E2B79@pmjones.io> <1BF3D29A-04C6-4A82-9216-EAE991A38916@pmjones.io> <10388b3a-3402-a6dc-3837-b03d735edf46@gmail.com> <5ec7b4a7-508b-270b-916f-0504a116196c@gmail.com> <30112AFF-38F9-44D4-9D2F-03A32019764F@pmjones.io> 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) > On Feb 26, 2020, at 14:12, Rowan Tommins = wrote: >=20 > On 26/02/2020 19:57, Paul M. Jones wrote: >=20 >> Do you mean something like this in the ServerRequest constructor? >>=20 >> ... >=20 > That's the easy part, yes; the harder part is this: >=20 > ... Yes, that would definitely be the harder part. > Recreating that functionality in userland is non-trivial, but is = essential for several use cases, e.g. an event-based server like = ReactPHP, or a test using a saved request body as a fixture. >=20 > If both content types (application/x-www-form-urlencoded and = multipart/form-data) were handled, it would also mean that the = relationship $content -> $input would match the relationship php://input = -> $_POST by default, which seems consistent with the aim of matching = existing behaviour. Yes, it would indeed. However, it strikes me that the thing to do here = is not to try and embed that behavior in ServerRequest; rather, it would = be to expose the existing functionality on its own, so that ReactPHP = (and many others!) can use them, instead of having to roll their own in = userland (a la = )= . --=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