Skip to content

Commit afba2ec

Browse files
committed
Feature: interop env on localhost with once().
1 parent 2959eca commit afba2ec

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/Executor/ParallelExecutor.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@ class ParallelExecutor implements ExecutorInterface
120120
*/
121121
private $hasNonFatalException = false;
122122

123+
/**
124+
* @var Local
125+
*/
126+
private $localhost;
127+
128+
/**
129+
* @var Environment
130+
*/
131+
private $localEnv;
132+
123133
/**
124134
* @param InputDefinition $userDefinition
125135
*/
@@ -139,6 +149,8 @@ public function run($tasks, $servers, $environments, $input, $output)
139149
$this->input = $input;
140150
$this->output = new OutputWatcher($output);
141151
$this->informer = new Informer($this->output);
152+
$this->localhost = new Local();
153+
$this->localEnv = new Environment();
142154
$this->port = self::START_PORT;
143155

144156
connect:
@@ -292,7 +304,7 @@ public function sendTasks()
292304
$this->informer->startTask($taskName);
293305

294306
if ($task->isOnce()) {
295-
$task->run(new Context(new Local(), new Environment(), $this->input, $this->output));
307+
$task->run(new Context($this->localhost, $this->localEnv, $this->input, $this->output));
296308
$this->informer->endTask();
297309
} else {
298310
$this->tasksToDo = [];

src/Executor/SeriesExecutor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ public function run($tasks, $servers, $environments, $input, $output)
2222
{
2323
$output = new OutputWatcher($output);
2424
$informer = new Informer($output);
25+
$localhost = new Local();
26+
$localEnv = new Environment();
2527

2628
foreach ($tasks as $task) {
2729
$success = true;
2830
$informer->startTask($task->getName());
2931

3032
if ($task->isOnce()) {
31-
$task->run(new Context(new Local(), new Environment(), $input, $output));
33+
$task->run(new Context($localhost, $localEnv, $input, $output));
3234
} else {
3335
foreach ($servers as $serverName => $server) {
3436
if ($task->isOnServer($serverName)) {

0 commit comments

Comments
 (0)