Library that implements the library php-extended/php-io-interface
Library that implements the library php-extended/php-io-interface.
The installation of this library is made via composer.
Download composer.phar
from their website.
Then add to your composer.json :
"require": {
...
"php-extended/php-io-object": "^2",
...
}
Then run php composer.phar update
to install this library.
The autoloading of all classes of this library is made through composer's autoloader.
For the output stream:
use PhpExtended\Io\ConsoleOutputStream;
$console = new ConsoleOutputStream();
$console->write('<your string here>', true); // equivalent to echo '<your string>'."\n";
For the input stream:
use PhpExtended\Io\ConsoleInputStream;
$console = new ConsoleInputStream();
$input = $console->readline(); // equivalent to readline();
MIT (See license file).