dev-master
9999999-devPHP stream wrapper for using only a portion of a stream.
LGPL-3.0-or-later
The Requires
- php >=7.0
The Development Requires
by Dennis Birkholz
PHP stream wrapper for using only a portion of a stream.
This repository is a subtree split of the iqb/Morgue repository so it can be required as a stand alone package via composer. To open an issues or pull request, please go to the iqb/Morgue repository., (*2)
Via composer:, (*3)
composer require iqb/substream
The stream wrapper is registered for the iqb.substream://
protocol.
To use as substream, just open a new like that:, (*4)
use const iqb\stream\SUBSTREAM_SCHEME; $originalStream = \fopen('filename', 'r'); $offset = 25; $length = 100; $substream = \fopen(SUBSTREAM_SCHEME . "://$offset:$length/" . (int)$originalStream); \fseek($orignalStream, 50); \fseek($substream, 25); // Will not fail assert(\fread($originalStream, 50) === \fread($substream, 50));
PHP stream wrapper for using only a portion of a stream.
LGPL-3.0-or-later