Async standard console input & output (STDIN, STDOUT) for React PHP
Note: This project is in early alpha stage! Feel free to report any issues you encounter.
Once installed, you can use the following code to present a prompt in a CLI program:
$stdio = new Stdio($loop);
$stdio->getReadline()->setPrompt('Input > ');
$stdio->on('line', function ($line) use ($stdio) {
var_dump($line);
if ($line === 'quit') {
$stdio->end();
}
});
See also the examples.
The recommended way to install this library is through composer. New to composer?
{
"require": {
"clue/stdio-react": "dev-master"
}
}
MIT