Browse files

#7106 - fix for ZTS builds

  • Loading branch information...
1 parent 11a0481 commit 11c0fb580d19b2c7c170121d519ca3ee4fc710d6 @lizjulien lizjulien committed with fabpot Mar 2, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/Symfony/Component/Process/Process.php
View
7 src/Symfony/Component/Process/Process.php
@@ -128,8 +128,13 @@ 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')) {
+ // on gnu/linux, PHP builds with --enable-maintainer-zts are also affected
+ // @see : https://bugs.php.net/bug.php?id=51800
+ // @see : https://bugs.php.net/bug.php?id=50524
+
+ if (null === $this->cwd && (defined('ZEND_THREAD_SAFE') || defined('PHP_WINDOWS_VERSION_BUILD'))) {
$this->cwd = getcwd();
}
if (null !== $env) {

0 comments on commit 11c0fb5

Please sign in to comment.