PSR7Streams.rst 501 B

123456789101112131415161718
  1. Usage with PSR 7 Streams
  2. ===============
  3. PSR-7 streams are `standardized streams <https://www.php-fig.org/psr/psr-7/>`_.
  4. ZipStream-PHP supports working with these streams with the function
  5. ``addFileFromPsr7Stream``.
  6. For all parameters of the function see the API documentation.
  7. Example
  8. ---------------
  9. .. code-block:: php
  10. $stream = $response->getBody();
  11. // add a file named 'streamfile.txt' from the content of the stream
  12. $zip->addFileFromPsr7Stream('streamfile.txt', $stream);