X

Create New Item

File Folder

X

Search Results

File "PSR7Streams.rst"

Full path: /home/andyrdhboardrevi/public_html/learn.andyrdhboardreview.com/vendor/maennchen/zipstream-php/guides/PSR7Streams.rst
File size: 538 B
MIME-type: text/plain
Charset: utf-8

Download   Open   Edit   Advanced Edit   Back

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,
    );