Download the PHP package digitalcz/streams without Composer
On this page you can find all versions of the php package digitalcz/streams. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download digitalcz/streams
More information about digitalcz/streams
Files in digitalcz/streams
Package streams
Short Description Opinionated abstraction around PHP streams implementing PSR-7 StreamInterface
License MIT
Homepage https://github.com/digitalcz/streams
Informations about the package streams
Streams
Opinionated abstraction around PHP streams implementing PSR-7 StreamInterface. It aims to improve working with files or remote streams in unified way.
Heavily inspired by guzzle/psr7.
Install
Via Composer
Usage
All streams implement DigitalCz\Streams\StreamInterface, which extends PSR-7
Psr\Http\Message\StreamInterface and adds a few convenience methods
(copy(), void-returning close()/seek(), …).
Stream
A wrapper around any PHP stream resource. Use Stream::from() to build one from
a string, a resource or another PSR-7 stream — the data is held in php://temp.
File
A stream backed by a real file on disk. Adds getPath() and delete().
TempFile
Like File, but backed by tmpfile() — the underlying file is removed
automatically once the stream handle is closed.
BufferedStream
Wraps a non-seekable / one-shot source stream and buffers what it reads into
php://temp, so the source can be re-read and seeked. It is read-only.
LimitStream
Read-only view of a window of another stream: at most $limit bytes starting
at $offset. Size, position and seeking are relative to the window.
AppendStream
Reads several streams one after another as if they were one (seekable parts are read from the start). It is read-only, seekable only if all parts are, and its size is unknown if any part's size is.
StreamWrapper
Turns a StreamInterface back into a native PHP stream resource, usable with
any function that expects one (fread, fgets, stream_copy_to_stream, …).
StreamInfo
Hashes or detects the MIME type of any PSR-7 stream without loading it all into
memory. Seekable streams are read from the start and their position is restored.
Non-seekable streams are read from the current position and the bytes read are
consumed — wrap them in BufferedStream if you need them again.
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Digital Solutions s.r.o.
- All Contributors
License
The MIT License (MIT). Please see License File for more information.