Browse Source

Merge pull request #453 from simensen/proxy-https

Fix downloading HTTPS dists through Proxy errors
Jordi Boggiano 13 years ago
parent
commit
76e49aa36c
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/Composer/Util/RemoteFilesystem.php

+ 2 - 3
src/Composer/Util/RemoteFilesystem.php

@@ -102,10 +102,9 @@ class RemoteFilesystem
             $this->io->write("    Downloading: <comment>connection...</comment>", false);
         }
 
+        $result = @file_get_contents($fileUrl, false, $ctx);
         if (null !== $fileName) {
-            $result = @copy($fileUrl, $fileName, $ctx);
-        } else {
-            $result = @file_get_contents($fileUrl, false, $ctx);
+            $result = @file_put_contents($fileName, $result) ? true : false;
         }
 
         // fix for 5.4.0 https://bugs.php.net/bug.php?id=61336