mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
CLI/Misc
* handle error case where setup is run automated and receives no input on STDIN
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user