From 893deada33a9fcabe6f9aa255cb25f418d7ba72a Mon Sep 17 00:00:00 2001 From: nonlux Date: Mon, 23 Feb 2015 14:40:20 +0000 Subject: [PATCH] Set the CommandExecutor buildPath property when a build is created. Closes #556 --- PHPCI/Builder.php | 2 ++ PHPCI/Helper/BaseCommandExecutor.php | 13 ++++++++++--- PHPCI/Helper/CommandExecutor.php | 6 ++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/PHPCI/Builder.php b/PHPCI/Builder.php index 904aa506c..d911e04bf 100644 --- a/PHPCI/Builder.php +++ b/PHPCI/Builder.php @@ -296,6 +296,8 @@ protected function setupBuild() PHPCI_URL ); + $this->commandExecutor->setBuildPath($this->buildPath); + // Create a working copy of the project: if (!$this->build->createWorkingCopy($this, $this->buildPath)) { throw new \Exception(Lang::get('could_not_create_working')); diff --git a/PHPCI/Helper/BaseCommandExecutor.php b/PHPCI/Helper/BaseCommandExecutor.php index 28247ebce..4c2f1fa8c 100644 --- a/PHPCI/Helper/BaseCommandExecutor.php +++ b/PHPCI/Helper/BaseCommandExecutor.php @@ -62,9 +62,7 @@ public function __construct(BuildLogger $logger, $rootDir, &$quiet = false, &$ve $this->logger = $logger; $this->quiet = $quiet; $this->verbose = $verbose; - $this->lastOutput = array(); - $this->rootDir = $rootDir; } @@ -92,7 +90,7 @@ public function executeCommand($args = array()) $pipes = array(); - $process = proc_open($command, $descriptorSpec, $pipes, dirname($this->buildPath), null); + $process = proc_open($command, $descriptorSpec, $pipes, $this->buildPath, null); if (is_resource($process)) { fclose($pipes[0]); @@ -219,4 +217,13 @@ public function getComposerBinDir($path) } return null; } + + /** + * Set the buildPath property. + * @param string $path + */ + public function setBuildPath($path) + { + $this->buildPath = $path; + } } diff --git a/PHPCI/Helper/CommandExecutor.php b/PHPCI/Helper/CommandExecutor.php index d83f0c6b7..bacd1a2e3 100644 --- a/PHPCI/Helper/CommandExecutor.php +++ b/PHPCI/Helper/CommandExecutor.php @@ -30,4 +30,10 @@ public function getLastOutput(); * @return null|string */ public function findBinary($binary, $buildPath = null); + + /** + * Set the buildPath property. + * @param string $path + */ + public function setBuildPath($path); }