11# clue/stdio-react [ ![ Build Status] ( https://travis-ci.org/clue/php-stdio-react.svg?branch=master )] ( https://travis-ci.org/clue/php-stdio-react )
22
3- Async, event-driven and UTF-8 aware console input & output (STDIN, STDOUT), built on top of for React PHP
3+ Async, event-driven and UTF-8 aware console input & output (STDIN, STDOUT),
4+ built on top of for [ ReactPHP] ( https://reactphp.org ) .
45
5- ** Table of Contents **
6+ ** Table of contents **
67
78* [ Quickstart example] ( #quickstart-example )
89* [ Usage] ( #usage )
@@ -64,14 +65,14 @@ $stdio = new Stdio($loop);
6465
6566See below for waiting for user input and writing output.
6667Alternatively, the ` Stdio ` is also a well-behaving duplex stream
67- (implementing React 's ` DuplexStreamInterface ` ) that emits each complete
68+ (implementing ReactPHP 's ` DuplexStreamInterface ` ) that emits each complete
6869line as a ` data ` event (including the trailing newline). This is considered
6970advanced usage.
7071
7172#### Output
7273
7374The ` Stdio ` is a well-behaving writable stream
74- implementing React 's ` WritableStreamInterface ` .
75+ implementing ReactPHP 's ` WritableStreamInterface ` .
7576
7677The ` writeln($line) ` method can be used to print a line to console output.
7778A trailing newline will be added automatically.
@@ -102,7 +103,7 @@ You can `pipe()` any readable stream into this stream.
102103#### Input
103104
104105The ` Stdio ` is a well-behaving readable stream
105- implementing React 's ` ReadableStreamInterface ` .
106+ implementing ReactPHP 's ` ReadableStreamInterface ` .
106107
107108It will emit a ` line ` event for every line read from console input.
108109The event will contain the input buffer as-is, without the trailing newline.
@@ -143,7 +144,7 @@ $readline = $stdio->getReadline();
143144
144145See above for waiting for user input.
145146Alternatively, the ` Readline ` is also a well-behaving readable stream
146- (implementing React 's ` ReadableStreamInterface ` ) that emits each complete
147+ (implementing ReactPHP 's ` ReadableStreamInterface ` ) that emits each complete
147148line as a ` data ` event (without the trailing newline). This is considered
148149advanced usage.
149150
@@ -547,13 +548,24 @@ ob_start(function ($chunk) use ($stdio) {
547548The recommended way to install this library is [ through Composer] ( https://getcomposer.org ) .
548549[ New to Composer?] ( https://getcomposer.org/doc/00-intro.md )
549550
551+ This project follows [ SemVer] ( http://semver.org/ ) .
550552This will install the latest supported version:
551553
552554``` bash
553- $ composer require clue/stdio-react:^1.0
555+ $ composer require clue/stdio-react:^1.1
554556```
555557
556- More details and upgrade guides can be found in the [ CHANGELOG] ( CHANGELOG.md ) .
558+ See also the [ CHANGELOG] ( CHANGELOG.md ) for details about version upgrades.
559+
560+ This project aims to run on any platform and thus does not require any PHP
561+ extensions and supports running on legacy PHP 5.3 through current PHP 7+ and
562+ HHVM.
563+ It's * highly recommended to use PHP 7+* for this project.
564+
565+ Internally, it will use the ` ext-mbstring ` to count and measure string sizes.
566+ If this extension is missing, then this library will use a slighty slower Regex
567+ work-around that should otherwise work equally well.
568+ Installing ` ext-mbstring ` is highly recommended.
557569
558570Note that * Microsoft Windows is not supported* .
559571Due to platform inconsistencies, PHP does not provide support for reading from
@@ -571,7 +583,7 @@ See also [#18](https://github.com/clue/php-stdio-react/issues/18) for more detai
571583## Tests
572584
573585To run the test suite, you first need to clone this repo and then install all
574- dependencies [ through Composer] ( http ://getcomposer.org) :
586+ dependencies [ through Composer] ( https ://getcomposer.org) :
575587
576588``` bash
577589$ composer install
0 commit comments