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

Never display errors, log them instead

This commit is contained in:
Niklas Keller 2017-06-21 15:30:52 +02:00
parent 29a1d1bb8c
commit d3ccd57d23

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 = []) {
$binary = \PHP_SAPI === "phpdbg" ? \PHP_BINARY . " -qrr --" : \PHP_BINARY;
$options = "-d html_errors=0 -d display_errors=0 -d log_errors=1";
$binary = \PHP_SAPI === "phpdbg" ? \PHP_BINARY . " -b -qrr $options --" : \PHP_BINARY . " " . $options;
$command = $binary . " " . \escapeshellarg($path);
$this->process = new Process($command, $cwd, $env);
}