Permalink
Browse files

merged branch lizjulien/7106 (PR #7248)

This PR was submitted for the master branch but it was merged into the 2.1 branch instead (closes #7248).

Discussion
----------

#7106 - check php version for getcwd()

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7106
| License       | MIT

Commits
-------

11d3855  #7106 - fix for ZTS builds
  • Loading branch information...
2 parents 11a0481 + 11c0fb5 commit 78ebba558ed67b66a365b105af3cbf7133ae46a1 @fabpot fabpot committed Mar 23, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 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 78ebba5

Please sign in to comment.