Line reader stream to forward complete lines to a stream.
Table of Contents
The center of this project is the
This class checks incoming data for an new line delimiter, if the delimeter has been found in the current data chunk the data will be exposed on the stream.
When the new line delimeter isn't found the data chunk,
it will be buffered until a delimiter occures.
LineReader is a duplex stream, so a readable and writable stream at the same time.
examples how you can use this project.
$ cat words.txt | php examples/readLine.php
This example makes clear what example this project can be used for. Every line with a new line delimiter will put into the readable stream. Every other line without a new line delimiter will be buffered until another occures.
The first parameter of the
LineReader is the custom delimiter.
The default value of this delimiter is
This will install the latest supported version:
$ composer require legionth/line-react:^0.2
See also the CHANGELOG for details about version upgrades.