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

Skip to content

Commit 03914e9

Browse files
bug #22613 [Process] Fix incorrectly calling PHP process when path contains space (maryo)
This PR was merged into the 3.3-dev branch. Discussion ---------- [Process] Fix incorrectly calling PHP process when path contains space | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #22556 | License | MIT I have PHP installed at "D:\Program Files\PHP" which contains a space. `PhpExecutableFinder` found it but then `PhpProcess` splitted the path by space. This PR fixes it. I wanted to write a test but I don't know ho to do it properly since it is dependent on the location where PHP is installed and I can't even mock `PhpExecutableFinder` because it is hardcoded dependency and an implementation detail. Commits ------- 9c08109 Fix incorrectly calling PHP process on Windows when path contains space
2 parents fb532bf + 9c08109 commit 03914e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Process/PhpProcess.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ class PhpProcess extends Process
3636
public function __construct($script, $cwd = null, array $env = null, $timeout = 60, array $options = null)
3737
{
3838
$executableFinder = new PhpExecutableFinder();
39-
if (false === $php = $executableFinder->find()) {
39+
if (false === $php = $executableFinder->find(false)) {
4040
$php = null;
4141
} else {
42-
$php = explode(' ', $php);
42+
$php = array_merge(array($php), $executableFinder->findArguments());
4343
}
4444
if ('phpdbg' === PHP_SAPI) {
4545
$file = tempnam(sys_get_temp_dir(), 'dbg');

0 commit comments

Comments
 (0)