keven/append-stream

Append stream resources into a single stream to read from.

1.0.5 2018-04-13 08:59 UTC

This package is auto-updated.

Last update: 2024-03-23 07:30:09 UTC


README

Concatenate streams without bloating the memory.

Install

$ composer install keven/append-stream

Usage

<?php

use Keven\AppendStream\AppendStream;

// Concatenate 3 streams
$handle = (new AppendStream([
    fopen('data://text/plain,stream1','r'),
    fopen('data://text/plain,stream2','r'),
    fopen('data://text/plain,stream3','r'),
]))->getResource();

echo stream_get_contents($handle);
// stream1stream2stream3