Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 78ebba5

Browse files
committed
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
2 parents 11a0481 + 11c0fb5 commit 78ebba5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,13 @@ public function __construct($commandline, $cwd = null, array $env = null, $stdin
128128

129129
$this->commandline = $commandline;
130130
$this->cwd = $cwd;
131+
131132
// on windows, if the cwd changed via chdir(), proc_open defaults to the dir where php was started
132-
if (null === $this->cwd && defined('PHP_WINDOWS_VERSION_BUILD')) {
133+
// on gnu/linux, PHP builds with --enable-maintainer-zts are also affected
134+
// @see : https://bugs.php.net/bug.php?id=51800
135+
// @see : https://bugs.php.net/bug.php?id=50524
136+
137+
if (null === $this->cwd && (defined('ZEND_THREAD_SAFE') || defined('PHP_WINDOWS_VERSION_BUILD'))) {
133138
$this->cwd = getcwd();
134139
}
135140
if (null !== $env) {

0 commit comments

Comments
 (0)