Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108529 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 71726 invoked from network); 13 Feb 2020 08:30:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Feb 2020 08:30:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F1D2F1804AB for ; Wed, 12 Feb 2020 22:45:18 -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=-1.1 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NEUTRAL autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS20857 149.210.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail.alphaserver.nl (mail.alphaserver.nl [149.210.157.144]) by php-smtp4.php.net (Postfix) with ESMTP for ; Wed, 12 Feb 2020 22:45:18 -0800 (PST) X-Virus-Scanned: amavisd-new at mail.alphaserver.nl Message-ID: <4E050173-8FCC-4770-BCD2-22DB22E24EFC@php.net> Content-Type: multipart/signed; boundary="Apple-Mail=_A31614E4-C2C8-491A-A5A5-B1C927FF7700"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Date: Thu, 13 Feb 2020 07:45:06 +0100 In-Reply-To: Cc: PHP Internals List To: "Paul M. Jones" References: <50BD013E-CF72-414C-BBC0-A7A2E45CBDDB@pmjones.io> <3efc8ed3-61a8-dad8-dd1f-207217589eba@allenjb.me.uk> X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2) From: ruudboon@php.net (Ruud Boon) --Apple-Mail=_A31614E4-C2C8-491A-A5A5-B1C927FF7700 Content-Type: multipart/alternative; boundary="Apple-Mail=_9C16F5E4-0018-4038-86FB-47C751F8EEE0" --Apple-Mail=_9C16F5E4-0018-4038-86FB-47C751F8EEE0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi! I really like this RFC. > On 12 Feb 2020, at 23:46, Paul M. Jones wrote: >=20 > Hi Allen & Robin, >=20 > Allen, you asked: >=20 >> On Feb 12, 2020, at 15:27, AllenJB wrote: >>=20 >> This might be more a "future scope" thing, but I would like to see a = way to access the raw request body as part of this. Currently (as far as = I know) the only way is to open/read php://input, which isn't = particularly intuitive in my opinion. >=20 >=20 > Robin asked the same thing earlier: >=20 >> On Feb 11, 2020, at 08:24, Kingsquare.nl - Robin Speekenbrink = wrote: >>=20 >> What i haven't clearly seen in the RFC nor the interfaces of the = proposed objects: how will this handle PUT / php:://input / raw posted = data? Or am i missing something? >=20 > Answer: the php://input stream is accessible via the ServerRequest = $content property; see = . In the the RFC I see that $content will return php://input = using file_get_contents on the fly. Can we add the = possibility to get a reference to the stream as well? This allows the = use of stream_copy_to_stream, mime_content_type etc without reading the = fill input to memory. >=20 >=20 > -- > Paul M. Jones > pmjones@pmjones.io > http://paul-m-jones.com >=20 > Modernizing Legacy Applications in PHP > https://leanpub.com/mlaphp >=20 > Solving the N+1 Problem in PHP > https://leanpub.com/sn1php >=20 > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php Cheers, Ruud --Apple-Mail=_9C16F5E4-0018-4038-86FB-47C751F8EEE0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Hi!

I really = like this RFC. 
On 12 Feb 2020, at 23:46, Paul M. Jones = <pmjones@pmjones.io> wrote:

Hi = Allen & Robin,

Allen, you asked:

On Feb = 12, 2020, at 15:27, AllenJB <php.lists@allenjb.me.uk> wrote:

This might be more a "future scope" thing, but I would like = to see a way to access the raw request body as part of this. Currently = (as far as I know) the only way is to open/read php://input, which isn't particularly intuitive in my = opinion.


Robin = asked the same thing earlier:

On Feb 11, 2020, at 08:24, Kingsquare.nl - Robin = Speekenbrink <robin@kingsquare.nl> wrote:

What i haven't clearly seen in the RFC nor the interfaces of = the proposed objects: how will this handle PUT / php:://input / raw = posted data? Or am i missing something?

Answer: the php://input = stream is accessible via the ServerRequest $content property; see <https://github.com/pmjones/ext-request#content-related>.=
In the the RFC I see that = $content will return  php://input using file_get_contents on the fly. = Can we add the possibility to get a reference to the stream as well? = This allows the use of stream_copy_to_stream, mime_content_type etc = without reading the fill input to memory.



--
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
Cheers,
Ruud
= --Apple-Mail=_9C16F5E4-0018-4038-86FB-47C751F8EEE0-- --Apple-Mail=_A31614E4-C2C8-491A-A5A5-B1C927FF7700 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEZHYyd+Vmbnnda/3K8un5FN+hvNcFAl5E8HIACgkQ8un5FN+h vNdsug//SSgj/U6c1bHIQWV3bq0h/g/Yeqc1ucet4S9sAPZyPBUdfusID0+l6Xbh B44ofgGvS5YZgn686i7PTgM3h4rIkCNu47N+gjx+ZGc7u0tvx3rhk6Otn1QvBZL4 WMdtGKp/rf40dWmrTCU8Ly49ouRfqCP72IUPQDtiOfvXxx/ddZ9i7gJobg564M48 UKMzQbJ5JVLNlInbe/QkktKqxILv3HyqlXgrhNtNqWKC/vclgr/2VTcAqRTlob8f e1L4YT2AwuwAasL0deyvB7+QENUFWnJYkQkFgFwuJFWvx1gSXh+z9iEH9WYm3C0Y L/u7wZgXDfida4aT/AG3qVzRYfzB1UzabOs9imBWbNXUYwkSrg09furm+frDH9hf 9d6PAvuHi/gCe9zYzytsdlGLpmqEVVL+1QKJVldnyXdGcySYI3/5wagLHvMBCXxQ gUg8bpv4J6vVyMRy34ICMRfRbOcbZk4Boet+8IRukZfr6mf+zgwHLLUFgjKX0XFw ABDJXtWEjjpCJl/5NQ6+m5bdXIQcztNmEAMxtR1bv76+WDXTgjCLcyetggx0WZJp rmHZLAtgGqqhaQE9t2L+dq2oXJ/KZw6KAwxTNqzkelCgOrpciuiAxaIJjb4eAeew Cd+LWQpr7K9OJKn9ROvyItjafo1zBTzJsKJOCzzCt41fyhZQF78= =0R9t -----END PGP SIGNATURE----- --Apple-Mail=_A31614E4-C2C8-491A-A5A5-B1C927FF7700--