CLI library to work with inputs/outputs from/to the gnu/linux terminal .
MIT
- php7.
- Input/output streams local.
- exec function activated.
- Gnu/Linux system or mac os (not working on Microsoft Widnows).
sudo composer require waliddz/hydrogen-console dev-master
<?php
require "vendor/autoload.php";
use Console\Input\Classes\Input as Input;
use Console\Output\Classes\Output as Output;
$Input = new Input;
$Output = new Output;
$Input->process($argv);
$Input->ask("Would you like a tea ?", function($answer) use ($Output) {
if($answer === "yes") {
$Output->write("preparing the tea ...","green");
}
});
?>