[Console] remove readline support

This commit is contained in:
Christian Flothmann 2016-02-03 18:56:43 +01:00
parent bad218d44e
commit 0e45a4a5de
2 changed files with 10 additions and 25 deletions

View File

@ -1,6 +1,11 @@
CHANGELOG
=========
2.8.3
-----
* remove readline support from the question helper as it caused issues
2.8.0
-----

View File

@ -134,7 +134,11 @@ class QuestionHelper extends Helper
}
if (false === $ret) {
$ret = $this->readFromInput($inputStream);
$ret = fgets($inputStream, 4096);
if (false === $ret) {
throw new \RuntimeException('Aborted');
}
$ret = trim($ret);
}
} else {
$ret = trim($this->autocomplete($output, $question, $inputStream));
@ -427,30 +431,6 @@ class QuestionHelper extends Helper
return self::$shell;
}
/**
* Reads user input.
*
* @param resource $stream The input stream
*
* @return string User input
*
* @throws RuntimeException
*/
private function readFromInput($stream)
{
if (STDIN === $stream && function_exists('readline')) {
$ret = readline('');
} else {
$ret = fgets($stream, 4096);
}
if (false === $ret) {
throw new RuntimeException('Aborted');
}
return trim($ret);
}
/**
* Returns whether Stty is available or not.
*