CLI/Misc
* handle error case where setup is run automated and receives no input on STDIN
This commit is contained in:
parent
36aa33ac26
commit
bd1f139c2e
1 changed files with 6 additions and 1 deletions
|
|
@ -288,7 +288,12 @@ abstract class CLI
|
|||
continue;
|
||||
|
||||
// stream_get_contents is always blocking under WIN - fgets should work similary as php always receives a terminated line of text
|
||||
$chars = str_split(OS_WIN ? fgets(STDIN) : stream_get_contents(STDIN));
|
||||
$chars = str_split(OS_WIN ? fgets(STDIN) : stream_get_contents(STDIN));
|
||||
|
||||
// $chars can be empty if used non-interactive
|
||||
if (!$chars)
|
||||
return false;
|
||||
|
||||
$ordinals = array_map('ord', $chars);
|
||||
|
||||
if ($ordinals[0] == self::CHR_ESC)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue