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;
|
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');
|
$password = file_get_contents('php://stdin');
|
||||||
|
stream_set_blocking(STDIN, 1);
|
||||||
if (trim($password) !== '') {
|
if (trim($password) !== '') {
|
||||||
$input->setOption('password', $password);
|
$input->setOption('password', $password);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue