Avoid opening php://stdin multiple times, fixes #12107
parent
1b5b56f234
commit
3e7b826904
|
@ -153,7 +153,10 @@ class Application extends BaseApplication
|
|||
$this->disablePluginsByDefault = $input->hasParameterOption('--no-plugins');
|
||||
$this->disableScriptsByDefault = $input->hasParameterOption('--no-scripts');
|
||||
|
||||
$stdin = defined('STDIN') ? STDIN : fopen('php://stdin', 'r');
|
||||
static $stdin = null;
|
||||
if (null === $stdin) {
|
||||
$stdin = defined('STDIN') ? STDIN : fopen('php://stdin', 'r');
|
||||
}
|
||||
if (Platform::getEnv('COMPOSER_TESTS_ARE_RUNNING') !== '1' && (Platform::getEnv('COMPOSER_NO_INTERACTION') || $stdin === false || !Platform::isTty($stdin))) {
|
||||
$input->setInteractive(false);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue