10000 [Console] remove readline support · symfony/symfony@0e45a4a · GitHub
[go: up one dir, main page]

Skip to content

Commit 0e45a4a

Browse files
committed
[Console] remove readline support
1 parent bad218d commit 0e45a4a

File tree

2 files changed

+10
-25
lines changed

2 files changed

+10
-25
lines changed

src/Symfony/Component/Console/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
2.8.3
5+
-----
6+
7+
* remove readline support from the question helper as it caused issues
8+
49
2.8.0
510
-----
611

src/Symfony/Component/Console/Helper/QuestionHelper.php

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ public function doAsk(OutputInterface $output, Question $question)
134134
}
135135

136136
if (false === $ret) {
137-
$ret = $this->readFromInput($inputStream);
137+
$ret = fgets($inputStream, 4096);
138+
if (false === $ret) {
139+
throw new \RuntimeException('Aborted');
140+
}
141+
$ret = trim($ret);
138142
}
139143
} else {
140144
$ret = trim($this->autocomplete($output, $question, $inputStream));
@@ -427,30 +431,6 @@ private function getShell()
427431
return self::$shell;
428432
}
429433

430-
/**
431-
* Reads user input.
432-
*
433-
* @param resource $stream The input stream
434-
*
435-
* @return string User input
436-
*
437-
* @throws RuntimeException
438-
*/
439-
private function readFromInput($stream)
440-
{
441-
if (STDIN === $stream && function_exists('readline')) {
442-
$ret = readline('');
443-
} else {
444-
$ret = fgets($stream, 4096);
445-
}
446-
447-
if (false === $ret) {
448-
throw new RuntimeException('Aborted');
449-
}
450-
451-
return trim($ret);
452-
}
453-
454434
/**
455435
* Returns whether Stty is available or not.
456436
*

0 commit comments

Comments
 (0)
0