Skip to content

Commit 1de16cd

Browse files
Merge branch '2.8' into 3.0
* 2.8: [Console] remove readline support [Routing] added a suggestion to add the HttpFoundation component. [travis] Add some comments changed operator from and to && Fixed the Bootstrap form theme for inlined checkbox/radio
2 parents 5a02eaa + d59b01b commit 1de16cd

File tree

2 files changed

+10
-25
lines changed

2 files changed

+10
-25
lines changed

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

Helper/QuestionHelper.php

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ private function doAsk(OutputInterface $output, Question $question)
130130
}
131131

132132
if (false === $ret) {
133-
$ret = $this->readFromInput($inputStream);
133+
$ret = fgets($inputStream, 4096);
134+
if (false === $ret) {
135+
throw new \RuntimeException('Aborted');
136+
}
137+
$ret = trim($ret);
134138
}
135139
} else {
136140
$ret = trim($this->autocomplete($output, $question, $inputStream));
@@ -423,30 +427,6 @@ private function getShell()
423427
return self::$shell;
424428
}
425429

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

0 commit comments

Comments
 (0)