From 0c5f4d98605e272dc7b18ceb6454abf46f2a6586 Mon Sep 17 00:00:00 2001 From: mwhittom Date: Thu, 17 Oct 2013 13:39:32 -0500 Subject: [PATCH] Update to fix issue with multiple perforce repositories --- src/Composer/Downloader/PerforceDownloader.php | 1 + src/Composer/Util/Perforce.php | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Composer/Downloader/PerforceDownloader.php b/src/Composer/Downloader/PerforceDownloader.php index 3aa8d0a43..011c0f593 100644 --- a/src/Composer/Downloader/PerforceDownloader.php +++ b/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; } diff --git a/src/Composer/Util/Perforce.php b/src/Composer/Util/Perforce.php index 5bb368575..ecaf3a720 100644 --- a/src/Composer/Util/Perforce.php +++ b/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;