Skip to content

Commit 26a323b

Browse files
committed
redirect stderr via descriptor spec
see php/php-src#13778 (comment)
1 parent 75efa73 commit 26a323b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Util/PHP/AbstractPhpProcess.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,6 @@ public function getCommand(array $settings, ?string $file = null): array
203203
$command[] = $this->arguments;
204204
}
205205

206-
if ($this->stderrRedirection) {
207-
$command[] = '2>&1';
208-
}
209-
210206
return $command;
211207
}
212208

src/Util/PHP/DefaultPhpProcess.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ protected function runProcess(string $job, array $settings): array
9494
1 => $handles[1] ?? ['pipe', 'w'],
9595
2 => $handles[2] ?? ['pipe', 'w'],
9696
];
97+
if ($this->stderrRedirection) {
98+
$pipeSpec[2] = ['redirect', 1];
99+
}
97100

98101
$process = proc_open(
99102
$this->getCommand($settings, $this->tempFile),

0 commit comments

Comments
 (0)