22 lines
538 B
ReStructuredText
Raw Normal View History

2024-07-10 18:28:19 +05:45
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
2024-09-29 16:59:27 +05:45
2024-07-10 18:28:19 +05:45
$stream = $response->getBody();
// add a file named 'streamfile.txt' from the content of the stream
2024-09-29 16:59:27 +05:45
$zip->addFileFromPsr7Stream(
fileName: 'streamfile.txt',
stream: $stream,
);