19 lines
501 B
ReStructuredText
Raw Normal View History

2023-07-15 10:16:32 +08:00
Usage with PSR 7 Streams
===============
PSR-7 streams are `standardized streams <https://www.php-fig.org/psr/psr-7/>`_.
ZipStream-PHP supports working with these streams with the function
``addFileFromPsr7Stream``.
For all parameters of the function see the API documentation.
Example
---------------
.. code-block:: php
2023-08-09 15:01:26 +08:00
2023-07-15 10:16:32 +08:00
$stream = $response->getBody();
// add a file named 'streamfile.txt' from the content of the stream
2023-08-09 15:01:26 +08:00
$zip->addFileFromPsr7Stream('streamfile.txt', $stream);