Do not block when nothing is passed via stdin.
This commit is contained in:
parent
d2c7a8ee59
commit
854dd8fa7c
|
@ -123,8 +123,11 @@ class ConvertType extends Command {
|
|||
return;
|
||||
}
|
||||
|
||||
// Read from stdin
|
||||
// Read from stdin. stream_set_blocking is used to prevent blocking
|
||||
// when nothing is passed via stdin.
|
||||
stream_set_blocking(STDIN, 0);
|
||||
$password = file_get_contents('php://stdin');
|
||||
stream_set_blocking(STDIN, 1);
|
||||
if (trim($password) !== '') {
|
||||
$input->setOption('password', $password);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue