Fix self-update error handling, fixes #1738
parent
78c250da19
commit
ad69d15590
|
@ -50,10 +50,16 @@ EOT
|
||||||
|
|
||||||
$remoteFilename = $protocol . '://getcomposer.org/composer.phar';
|
$remoteFilename = $protocol . '://getcomposer.org/composer.phar';
|
||||||
$localFilename = $_SERVER['argv'][0];
|
$localFilename = $_SERVER['argv'][0];
|
||||||
$tempFilename = basename($localFilename, '.phar').'-temp.phar';
|
$tempFilename = dirname($localFilename) . '/' . basename($localFilename, '.phar').'-temp.phar';
|
||||||
|
|
||||||
$rfs->copy('getcomposer.org', $remoteFilename, $tempFilename);
|
$rfs->copy('getcomposer.org', $remoteFilename, $tempFilename);
|
||||||
|
|
||||||
|
if (!file_exists($tempFilename)) {
|
||||||
|
$output->writeln('<error>The download of the new composer version failed for an unexpected reason');
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
chmod($tempFilename, 0777 & ~umask());
|
chmod($tempFilename, 0777 & ~umask());
|
||||||
// test the phar validity
|
// test the phar validity
|
||||||
|
|
Loading…
Reference in New Issue