From 7d92786475f2b7d4a4f4be4f0076732ace155df2 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 17 Feb 2013 20:36:23 +0100 Subject: [PATCH] [Process] Fix regression introduced in #6620 / 880da01c49a9255f5022ab7e18bca38c18f56370, fixes #7082 --- Process.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Process.php b/Process.php index cf553ee1..a506e0c3 100644 --- a/Process.php +++ b/Process.php @@ -54,6 +54,10 @@ public function __construct($commandline, $cwd = null, array $env = null, $stdin $this->commandline = $commandline; $this->cwd = $cwd; + // on windows, if the cwd changed via chdir(), proc_open defaults to the dir where php was started + if (null === $this->cwd && defined('PHP_WINDOWS_VERSION_BUILD')) { + $this->cwd = getcwd(); + } if (null !== $env) { $this->env = array(); foreach ($env as $key => $value) {