12 define(
'ERR_SELECT_FAILED', 1);
13 define(
'ERR_TIMEOUT', 2);
14 define(
'ERR_READ_FAILED', 3);
15 define(
'ERR_WRITE_FAILED', 4);
20 stream_set_blocking(STDIN, 0);
21 stream_set_blocking(STDOUT, 0);
22 stream_set_blocking(STDERR, 0);
29 $n = stream_select(
$r,
$w, $e, 5);
37 if (in_array(STDOUT,
$w) && strlen(
$out) > 0) {
38 $written = fwrite(STDOUT, (binary)
$out, 32768);
39 if (
false === $written) {
42 $out = (binary) substr($out, $written);
48 if (in_array(STDERR,
$w) && strlen($err) > 0) {
49 $written = fwrite(STDERR, (binary) $err, 32768);
50 if (
false === $written) {
53 $err = (binary) substr($err, $written);
55 if (null ===
$read &&
'' === $err) {
60 $str = fread(STDIN, 32768);
65 if (
false === $str || feof(STDIN)) {
Create styles array
The data for the language used.