Jordi Boggiano пре 13 година
родитељ
комит
db03b7bbbd
2 измењених фајлова са 19 додато и 18 уклоњено
  1. 1 0
      src/Composer/Downloader/FileDownloader.php
  2. 18 18
      src/Composer/Util/RemoteFilesystem.php

+ 1 - 0
src/Composer/Downloader/FileDownloader.php

@@ -1,4 +1,5 @@
 <?php
+
 /*
  * This file is part of Composer.
  *

+ 18 - 18
src/Composer/Util/RemoteFilesystem.php

@@ -22,8 +22,8 @@ class RemoteFilesystem
     private $io;
     private $firstCall;
     private $bytesMax;
-    private $originUrl;
-    private $fileUrl;
+    private $originUrl;
+    private $fileUrl;
     private $fileName;
     private $content;
     private $progess;
@@ -81,26 +81,26 @@ class RemoteFilesystem
     {
         $this->firstCall = true;
         $this->bytesMax = 0;
-        $this->content = null;
-        $this->originUrl = $originUrl;
-        $this->fileUrl = $fileUrl;
+        $this->content = null;
+        $this->originUrl = $originUrl;
+        $this->fileUrl = $fileUrl;
         $this->fileName = $fileName;
-        $this->progress = $progess;
-
+        $this->progress = $progess;
+
         // add authorization in context
         $options = array();
-        if ($this->io->hasAuthorization($originUrl)) {
+        if ($this->io->hasAuthorization($originUrl)) {
             $auth = $this->io->getAuthorization($originUrl);
             $authStr = base64_encode($auth['username'] . ':' . $auth['password']);
             $options['http']['header'] = "Authorization: Basic $authStr\r\n";
-        } else if (null !== $this->io->getLastUsername()) {
-            $authStr = base64_encode($this->io->getLastUsername() . ':' . $this->io->getLastPassword());
-            $options['http'] = array('header' => "Authorization: Basic $authStr\r\n");
-            $this->io->setAuthorization($originUrl, $this->io->getLastUsername(), $this->io->getLastPassword());
-        }
-
-        $ctx = StreamContextFactory::getContext($options, array('notification' => array($this, 'callbackGet')));
-
+        } else if (null !== $this->io->getLastUsername()) {
+            $authStr = base64_encode($this->io->getLastUsername() . ':' . $this->io->getLastPassword());
+            $options['http'] = array('header' => "Authorization: Basic $authStr\r\n");
+            $this->io->setAuthorization($originUrl, $this->io->getLastUsername(), $this->io->getLastPassword());
+        }
+
+        $ctx = StreamContextFactory::getContext($options, array('notification' => array($this, 'callbackGet')));
+
         if ($this->progress) {
             $this->io->overwrite("    Downloading: <comment>connection...</comment>", false);
         }
@@ -110,8 +110,8 @@ class RemoteFilesystem
         } else {
             $result = @file_get_contents($fileUrl, false, $ctx);
             $this->content = $result;
-        }
-
+        }
+
         if ($this->progress) {
             $this->io->overwrite("    Downloading", false);
         }