소스 검색

Packages can't be added to two repos at once

Jordi Boggiano 13 년 전
부모
커밋
544067ced9
2개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/Composer/Installer/LibraryInstaller.php
  2. 5 0
      src/Composer/Package/BasePackage.php

+ 1 - 1
src/Composer/Installer/LibraryInstaller.php

@@ -81,7 +81,7 @@ class LibraryInstaller implements InstallerInterface
         $downloadPath = $this->directory.DIRECTORY_SEPARATOR.$package->getName();
 
         $this->downloadManager->download($package, $downloadPath);
-        $this->repository->addPackage($package);
+        $this->repository->addPackage(clone $package);
     }
 
     /**

+ 5 - 0
src/Composer/Package/BasePackage.php

@@ -153,4 +153,9 @@ abstract class BasePackage implements PackageInterface
     {
         return $this->getUniqueName();
     }
+
+    public function __clone()
+    {
+        $this->repository = null;
+    }
 }