diff --git a/bin/process.php b/bin/process.php index f19b399..597ed50 100644 --- a/bin/process.php +++ b/bin/process.php @@ -8,8 +8,8 @@ ob_start(function ($data) { }, 1, 0); $paths = [ - dirname(dirname(dirname(__DIR__))) . '/autoload.php', - dirname(__DIR__) . '/vendor/autoload.php', + dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'autoload.php', + dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php', ]; $autoloadPath = null; diff --git a/src/Process/Process.php b/src/Process/Process.php index 66053d4..ec7966c 100644 --- a/src/Process/Process.php +++ b/src/Process/Process.php @@ -148,7 +148,9 @@ class Process ['pipe', 'w'], // exit code pipe ]; - $command = sprintf('(%s) 3>/dev/null; code=$?; echo $code >&3; exit $code', $this->command); + $nd = 0 === strncasecmp(PHP_OS, 'WIN', 3) ? 'NUL' : '/dev/null'; + + $command = sprintf('(%s) 3>%s; code=$?; echo $code >&3; exit $code', $this->command, $nd); $this->process = proc_open($command, $fd, $pipes, $this->cwd ?: null, $this->env ?: null, $this->options);