mintware-de / streams
A implementation of the PSR-7 StreamInterface
Installs: 76 118
Dependents: 1
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 3
Open Issues: 0
Requires
- php: ^7.4 || ^8.0
- psr/http-message: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^v3.8.0
- phpstan/phpstan: ^1.4
- phpunit/phpunit: ^7.0 || ^8.0 || ^9.0
This package is auto-updated.
Last update: 2024-04-22 12:50:37 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 🙂