Skip to content

Commit 893dead

Browse files
nonluxDan Cryer
authored and
Dan Cryer
committed
Set the CommandExecutor buildPath property when a build is created.
Closes dancryer#556
1 parent 4905679 commit 893dead

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

PHPCI/Builder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ protected function setupBuild()
296296
PHPCI_URL
297297
);
298298

299+
$this->commandExecutor->setBuildPath($this->buildPath);
300+
299301
// Create a working copy of the project:
300302
if (!$this->build->createWorkingCopy($this, $this->buildPath)) {
301303
throw new \Exception(Lang::get('could_not_create_working'));

PHPCI/Helper/BaseCommandExecutor.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ public function __construct(BuildLogger $logger, $rootDir, &$quiet = false, &$ve
6262
$this->logger = $logger;
6363
$this->quiet = $quiet;
6464
$this->verbose = $verbose;
65-
6665
$this->lastOutput = array();
67-
6866
$this->rootDir = $rootDir;
6967
}
7068

@@ -92,7 +90,7 @@ public function executeCommand($args = array())
9290

9391
$pipes = array();
9492

95-
$process = proc_open($command, $descriptorSpec, $pipes, dirname($this->buildPath), null);
93+
$process = proc_open($command, $descriptorSpec, $pipes, $this->buildPath, null);
9694

9795
if (is_resource($process)) {
9896
fclose($pipes[0]);
@@ -219,4 +217,13 @@ public function getComposerBinDir($path)
219217
}
220218
return null;
221219
}
220+
221+
/**
222+
* Set the buildPath property.
223+
* @param string $path
224+
*/
225+
public function setBuildPath($path)
226+
{
227+
$this->buildPath = $path;
228+
}
222229
}

PHPCI/Helper/CommandExecutor.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,10 @@ public function getLastOutput();
3030
* @return null|string
3131
*/
3232
public function findBinary($binary, $buildPath = null);
33+
34+
/**
35+
* Set the buildPath property.
36+
* @param string $path
37+
*/
38+
public function setBuildPath($path);
3339
}

0 commit comments

Comments
 (0)