1
0
Fork 0

Avoid double xdebug warning with global command

pull/4761/head
Jordi Boggiano 2016-01-10 12:43:48 +00:00
parent 0119c00560
commit b056d9ae42
1 changed files with 19 additions and 19 deletions

View File

@ -107,6 +107,16 @@ class Application extends BaseApplication
ErrorHandler::register($this->io); ErrorHandler::register($this->io);
$io = $this->getIO(); $io = $this->getIO();
// determine command name to be executed
$commandName = '';
if ($name = $this->getCommandName($input)) {
try {
$commandName = $this->find($name)->getName();
} catch (\InvalidArgumentException $e) {
}
}
if ($commandName !== 'global') {
if (PHP_VERSION_ID < 50302) { if (PHP_VERSION_ID < 50302) {
$io->writeError('<warning>Composer only officially supports PHP 5.3.2 and above, you will most likely encounter problems with your PHP '.PHP_VERSION.', upgrading is strongly recommended.</warning>'); $io->writeError('<warning>Composer only officially supports PHP 5.3.2 and above, you will most likely encounter problems with your PHP '.PHP_VERSION.', upgrading is strongly recommended.</warning>');
} }
@ -115,20 +125,10 @@ class Application extends BaseApplication
$io->writeError('<warning>You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug</warning>'); $io->writeError('<warning>You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug</warning>');
} }
if (defined('COMPOSER_DEV_WARNING_TIME')) { if (defined('COMPOSER_DEV_WARNING_TIME') && $commandName !== 'self-update' && $commandName !== 'selfupdate' && time() > COMPOSER_DEV_WARNING_TIME) {
$commandName = '';
if ($name = $this->getCommandName($input)) {
try {
$commandName = $this->find($name)->getName();
} catch (\InvalidArgumentException $e) {
}
}
if ($commandName !== 'self-update' && $commandName !== 'selfupdate') {
if (time() > COMPOSER_DEV_WARNING_TIME) {
$io->writeError(sprintf('<warning>Warning: This development build of composer is over 60 days old. It is recommended to update it by running "%s self-update" to get the latest version.</warning>', $_SERVER['PHP_SELF'])); $io->writeError(sprintf('<warning>Warning: This development build of composer is over 60 days old. It is recommended to update it by running "%s self-update" to get the latest version.</warning>', $_SERVER['PHP_SELF']));
} }
} }
}
if (getenv('COMPOSER_NO_INTERACTION')) { if (getenv('COMPOSER_NO_INTERACTION')) {
$input->setInteractive(false); $input->setInteractive(false);