mintware-de/streams

A implementation of the PSR-7 StreamInterface

v3.0.0 2024-06-12 10:23 UTC

This package is auto-updated.

Last update: 2024-11-12 11:10:06 UTC


README

Packagist GitHub license Packagist

๐Ÿ’พ Streams for PHP

This package provides some implementations of the PSR-7 StreamInterface.

๐Ÿ“ฆ Installation

You can install this package using composer:

$ composer require mintware-de/streams

๐Ÿ“„ FileStream

Provides read / write access for files.

use \MintWare\Streams\FileStream;
$stream = new FileStream($filename, $readable = true, $writable = true);

๐Ÿ’ป MemoryStream

With this implementation you can read data from and write data to the memory.

use \MintWare\Streams\MemoryStream;
$stream = new MemoryStream($initialData = '');

๐Ÿ“ฅ InputStream

Provides read-only access for the php://input resource. This holds for example the raw HTTP request.

use \MintWare\Streams\InputStream;
$stream = new InputStream();

๐Ÿ“ค OutputStream

Provides write-only access for the php://output resource.

use \MintWare\Streams\OutputStream;
$stream = new OutputStream();

๐Ÿงช Unit Tests

$ phpunit

โญ๏ธ Rating

Don't forget to hit the โญ๏ธ-Star button if you find this package useful. Thanks ๐Ÿ™‚