Browse Source

Merge pull request #2345 from vuhl/master

Update to fix issue with multiple perforce repositories
Jordi Boggiano 11 years ago
parent
commit
f1fd9cbd01
2 changed files with 9 additions and 3 deletions
  1. 1 0
      src/Composer/Downloader/PerforceDownloader.php
  2. 8 3
      src/Composer/Util/Perforce.php

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

@@ -45,6 +45,7 @@ class PerforceDownloader extends VcsDownloader
     private function initPerforce($package, $path, $ref)
     {
         if ($this->perforce) {
+            $this->perforce->initializePath($path);
             return;
         }
 

+ 8 - 3
src/Composer/Util/Perforce.php

@@ -38,9 +38,7 @@ class Perforce
     {
         $this->windowsFlag = $isWindows;
         $this->p4Port = $port;
-        $this->path = $path;
-        $fs = new Filesystem();
-        $fs->ensureDirectoryExists($path);
+        $this->initializePath($path);
         $this->process = $process;
         $this->initialize($repoConfig);
     }
@@ -131,6 +129,13 @@ class Perforce
         return $this->path;
     }
 
+    public function initializePath($path)
+    {
+        $this->path = $path;
+        $fs = new Filesystem();
+        $fs->ensureDirectoryExists($path);
+    }
+
     protected function getPort()
     {
         return $this->p4Port;