Aggiornato Composer
This commit is contained in:
28
vendor/symfony/console/Helper/QuestionHelper.php
vendored
28
vendor/symfony/console/Helper/QuestionHelper.php
vendored
@@ -24,6 +24,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Question\ChoiceQuestion;
|
||||
use Symfony\Component\Console\Question\Question;
|
||||
use Symfony\Component\Console\Terminal;
|
||||
|
||||
use function Symfony\Component\String\s;
|
||||
|
||||
/**
|
||||
@@ -127,7 +128,18 @@ class QuestionHelper extends Helper
|
||||
}
|
||||
|
||||
if (false === $ret) {
|
||||
$isBlocked = stream_get_meta_data($inputStream)['blocked'] ?? true;
|
||||
|
||||
if (!$isBlocked) {
|
||||
stream_set_blocking($inputStream, true);
|
||||
}
|
||||
|
||||
$ret = $this->readInput($inputStream, $question);
|
||||
|
||||
if (!$isBlocked) {
|
||||
stream_set_blocking($inputStream, false);
|
||||
}
|
||||
|
||||
if (false === $ret) {
|
||||
throw new MissingInputException('Aborted.');
|
||||
}
|
||||
@@ -491,21 +503,7 @@ class QuestionHelper extends Helper
|
||||
return self::$stdinIsInteractive;
|
||||
}
|
||||
|
||||
if (\function_exists('stream_isatty')) {
|
||||
return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r'));
|
||||
}
|
||||
|
||||
if (\function_exists('posix_isatty')) {
|
||||
return self::$stdinIsInteractive = @posix_isatty(fopen('php://stdin', 'r'));
|
||||
}
|
||||
|
||||
if (!\function_exists('exec')) {
|
||||
return self::$stdinIsInteractive = true;
|
||||
}
|
||||
|
||||
exec('stty 2> /dev/null', $output, $status);
|
||||
|
||||
return self::$stdinIsInteractive = 1 !== $status;
|
||||
return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user