diff --git a/src/Symfony/Component/Console/Helper/DialogHelper.php b/src/Symfony/Component/Console/Helper/DialogHelper.php index d886807431016..cf4d60ab858fe 100644 --- a/src/Symfony/Component/Console/Helper/DialogHelper.php +++ b/src/Symfony/Component/Console/Helper/DialogHelper.php @@ -20,7 +20,7 @@ */ class DialogHelper extends Helper { - private $inputStream; + private $inputStream = STDIN; /** * Asks a question to the user. @@ -35,7 +35,8 @@ public function ask(OutputInterface $output, $question, $default = null) { $output->write($question); - if (false === $ret = stream_get_line(null === $this->inputStream ? STDIN : $this->inputStream, 4096, "\n")) { + $ret = fgets($this->inputStream, 4096); + if (false === $ret) { throw new \RuntimeException('Aborted'); } $ret = trim($ret);
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: