1
0
Fork 0

Fix self-update error handling, fixes #1738

pull/1745/head
Jordi Boggiano 2013-03-28 14:24:54 +01:00
parent 78c250da19
commit ad69d15590
1 changed files with 7 additions and 1 deletions

View File

@ -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