Эх сурвалжийг харах

Merge remote-tracking branch 'till/download-fun'

Jordi Boggiano 13 жил өмнө
parent
commit
edba29be45

+ 4 - 0
src/Composer/Downloader/DownloadManager.php

@@ -46,6 +46,7 @@ class DownloadManager
     public function setPreferSource($preferSource)
     public function setPreferSource($preferSource)
     {
     {
         $this->preferSource = $preferSource;
         $this->preferSource = $preferSource;
+        return $this;
     }
     }
 
 
     /**
     /**
@@ -56,7 +57,9 @@ class DownloadManager
      */
      */
     public function setDownloader($type, DownloaderInterface $downloader)
     public function setDownloader($type, DownloaderInterface $downloader)
     {
     {
+        $type = strtolower($type);
         $this->downloaders[$type] = $downloader;
         $this->downloaders[$type] = $downloader;
+        return $this;
     }
     }
 
 
     /**
     /**
@@ -70,6 +73,7 @@ class DownloadManager
      */
      */
     public function getDownloader($type)
     public function getDownloader($type)
     {
     {
+        $type = strtolower($type);
         if (!isset($this->downloaders[$type])) {
         if (!isset($this->downloaders[$type])) {
             throw new \InvalidArgumentException('Unknown downloader type: '.$type);
             throw new \InvalidArgumentException('Unknown downloader type: '.$type);
         }
         }