Skip to content

Commit

Permalink
Merge remote-tracking branch 'JohanHolman/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Feb 27, 2013
2 parents 2fbc26e + 602f14b commit 9fcf2c7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions web/installer
Expand Up @@ -272,9 +272,16 @@ function installComposer($installDir, $quiet)
$source = (extension_loaded('openssl') ? 'https' : 'http').'://getcomposer.org/composer.phar';
$errorHandler = new ErrorHandler();
set_error_handler(array($errorHandler, 'handleError'));
if (!copy($source, $file, getStreamContext())) {
out('Download failed: '.$errorHandler->message, 'error');

$fh = fopen($file, 'w');
if (!$fh) {
out('Create file $file failed: '.$errorHandler->message, 'error');
}
if (!fwrite($fh, file_get_contents($source, false, getStreamContext()))) {
out('Copy data to file $file failed: '.$errorHandler->message, 'error');
}
fclose($fh);

restore_error_handler();
if ($errorHandler->message) {
continue;
Expand Down

0 comments on commit 9fcf2c7

Please sign in to comment.