mintware-de / streams
A implementation of the PSR-7 StreamInterface
Installs: 79 960
Dependents: 2
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 3
Open Issues: 0
Requires
- php: ^8.2
- psr/http-message: ^2.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^v3.58.1
- phpstan/phpstan: ^1.11.4
- phpunit/phpunit: ^9.0 || ^10.0 || ^11.0
This package is auto-updated.
Last update: 2024-11-12 11:10:06 UTC
README
๐พ 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 ๐