diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index e92b45863..762425272 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -129,7 +129,7 @@ class Application extends BaseApplication { $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); } diff --git a/src/Composer/Util/Platform.php b/src/Composer/Util/Platform.php index a582a6fad..72396f0a7 100644 --- a/src/Composer/Util/Platform.php +++ b/src/Composer/Util/Platform.php @@ -93,7 +93,7 @@ class Platform public static function isTty($fd = null) { if ($fd === null) { - $fd = STDOUT; + $fd = defined('STDOUT') ? STDOUT : fopen('php://stdout', 'w'); } // modern cross-platform function, includes the fstat