class Stream
Command line streams manager
Use this class to write on STDOUT
or STDERR
and read from STDIN
.
Properties
$stream | STDOUT stream for writing | |
$error | STDERR stream for writing | |
$input | STDIN stream for reading |
Methods
__construct()
The three streams are initiated |
||
void |
__exit(string $str = null)
Exit the script execution |
|
void |
error(string $str, int $status = 1, bool $new_line = true)
Write a message on |
|
void |
write(string $str, bool $new_line = true)
Write a message on |
|
void |
prompt(string $str)
Write a message on |
|
string |
getUserResponse()
Get last user input on |
Details
at line 66
public
__construct()
The three streams are initiated
They are created with the defaults STDIN
, STDOUT
and STDERR
if present or
opened as file streams otherwise.
at line 79
public void
__exit(string $str = null)
Exit the script execution
at line 93
public void
error(string $str, int $status = 1, bool $new_line = true)
Write a message on STDERR
and exit with an error status
at line 107
public void
write(string $str, bool $new_line = true)
Write a message on STDOUT
at line 119
public void
prompt(string $str)
Write a message on STDOUT
and wait for a user input on STDIN
at line 130
public string
getUserResponse()
Get last user input on STDIN