1
0
mirror of https://github.com/danog/parallel.git synced 2025-01-22 14:01:14 +01:00

Fix binary when running via phpdbg

This commit is contained in:
Niklas Keller 2017-06-17 19:27:16 +02:00
parent a6bca0f085
commit 39664d42d0

View File

@ -28,7 +28,8 @@ class ChannelledProcess implements ProcessContext, Strand {
* @param mixed[] $env Array of environment variables.
*/
public function __construct(string $path, string $cwd = "", array $env = []) {
$command = \PHP_BINARY . " " . \escapeshellarg($path);
$binary = \PHP_SAPI === "phpdbg" ? \PHP_BINARY . " -qrr --" : \PHP_BINARY;
$command = $binary . " " . \escapeshellarg($path);
$this->process = new Process($command, $cwd, $env);
}