All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
22 lines
538 B
ReStructuredText
22 lines
538 B
ReStructuredText
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
|
|
|
|
$stream = $response->getBody();
|
|
// add a file named 'streamfile.txt' from the content of the stream
|
|
$zip->addFileFromPsr7Stream(
|
|
fileName: 'streamfile.txt',
|
|
stream: $stream,
|
|
);
|