Make sure we handle cases where STDIN/STDOUT may not be defined
parent
8936f724d4
commit
595c4c6f75
|
@ -129,7 +129,7 @@ class Application extends BaseApplication
|
||||||
{
|
{
|
||||||
$this->disablePluginsByDefault = $input->hasParameterOption('--no-plugins');
|
$this->disablePluginsByDefault = $input->hasParameterOption('--no-plugins');
|
||||||
|
|
||||||
if (getenv('COMPOSER_NO_INTERACTION') || !Platform::isTty(STDIN)) {
|
if (getenv('COMPOSER_NO_INTERACTION') || !Platform::isTty(defined('STDIN') ? STDIN : fopen('php://stdin', 'r'))) {
|
||||||
$input->setInteractive(false);
|
$input->setInteractive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ class Platform
|
||||||
public static function isTty($fd = null)
|
public static function isTty($fd = null)
|
||||||
{
|
{
|
||||||
if ($fd === null) {
|
if ($fd === null) {
|
||||||
$fd = STDOUT;
|
$fd = defined('STDOUT') ? STDOUT : fopen('php://stdout', 'w');
|
||||||
}
|
}
|
||||||
|
|
||||||
// modern cross-platform function, includes the fstat
|
// modern cross-platform function, includes the fstat
|
||||||
|
|
Loading…
Reference in New Issue