From 83ea90296e001c3df6f1eb9933db65c1d45a1b37 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 2 Apr 2013 10:34:49 +0200 Subject: [PATCH] Add COMPOSER_NO_INTERACTION env var to allow travis & others to easily make sure every composer run is non-interactive --- doc/03-cli.md | 5 +++++ src/Composer/Console/Application.php | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/doc/03-cli.md b/doc/03-cli.md index aa99a1371..de72f0136 100644 --- a/doc/03-cli.md +++ b/doc/03-cli.md @@ -423,4 +423,9 @@ configuration in the project's `composer.json` always wins. This env var controls the time composer waits for commands (such as git commands) to finish executing. The default value is 300 seconds (5 minutes). +### COMPOSER_NO_INTERACTION + +If set to 1, this env var will make composer behave as if you passed the +`--no-interaction` flag to every command. This can be set on build boxes/CI. + ← [Libraries](02-libraries.md) | [Schema](04-schema.md) → diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index 40dfd9eb9..214b6ca5a 100755 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -100,6 +100,10 @@ class Application extends BaseApplication } } + if (getenv('COMPOSER_NO_INTERACTION')) { + $input->setInteractive(false); + } + if ($input->hasParameterOption('--profile')) { $startTime = microtime(true); $this->io->enableDebugging($startTime);