8000 bug #17669 [Console] remove readline support (xabbuh) · symfony/symfony@c8678f4 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c8678f4

Browse files
committed
bug #17669 [Console] remove readline support (xabbuh)
This PR was merged into the 2.8 branch. Discussion ---------- [Console] remove readline support | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15583 | License | MIT | Doc PR | Commits ------- 0e45a4a [Console] remove readline support
2 parents bad218d + 0e45a4a commit c8678f4

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