PSR7Streams.rst 501 字节

Usage with PSR 7 Streams

PSR-7 streams are standardized streams.

ZipStream-PHP supports working with these streams with the function addFileFromPsr7Stream.

For all parameters of the function see the API documentation.

Example

$stream = $response->getBody();
// add a file named 'streamfile.txt' from the content of the stream
$zip->addFileFromPsr7Stream('streamfile.txt', $stream);