don't display dev expiration time warning when running self-update command
parent
74c2fd5f06
commit
2448c5a7c2
|
@ -187,12 +187,11 @@ EOF;
|
||||||
|
|
||||||
// add warning once the phar is older than 30 days
|
// add warning once the phar is older than 30 days
|
||||||
if (preg_match('{^[a-f0-9]+$}', $this->version)) {
|
if (preg_match('{^[a-f0-9]+$}', $this->version)) {
|
||||||
$stub .= 'if (time() > '.(time()+30*86400).') {'.
|
$warningTime = time() + 30*86400;
|
||||||
"\n echo 'This dev build of composer is outdated, please run \"'.\$argv[0].' self-update\" to get the latest.'.PHP_EOL;".
|
$stub .= "define('COMPOSER_DEV_WARNING_TIME', $warningTime);\n";
|
||||||
"\n}\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $stub .= <<<'EOF'
|
return $stub . <<<'EOF'
|
||||||
require 'phar://composer.phar/bin/composer';
|
require 'phar://composer.phar/bin/composer';
|
||||||
|
|
||||||
__HALT_COMPILER();
|
__HALT_COMPILER();
|
||||||
|
|
|
@ -77,6 +77,12 @@ class Application extends BaseApplication
|
||||||
$output->writeln('<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>');
|
$output->writeln('<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>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (defined('COMPOSER_DEV_WARNING_TIME') && $this->getCommandName($input) !== 'self-update') {
|
||||||
|
if (time() > COMPOSER_DEV_WARNING_TIME) {
|
||||||
|
$output->writeln(sprintf('<warning>This dev build of composer is outdated, please run "%s self-update" to get the latest version.</warning>', $_SERVER['PHP_SELF']));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return parent::doRun($input, $output);
|
return parent::doRun($input, $output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue