Skip to content

Commit 1728dcc

Browse files
minor symfony#16599 [Process] Fix trailing space in PHP binary finder (nicolas-grekas)
This PR was merged into the 2.3 branch. Discussion ---------- [Process] Fix trailing space in PHP binary finder | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#16598 | License | MIT | Doc PR | - Commits ------- f15e6e0 [Process] Fix trailing space in PHP binary finder
2 parents 49aa6d4 + f15e6e0 commit 1728dcc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Symfony/Component/Process/PhpExecutableFinder.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,17 @@ public function __construct()
3535
*/
3636
public function find($includeArgs = true)
3737
{
38+
$args = $this->findArguments();
39+
$args = $includeArgs && $args ? ' '.implode(' ', $args) : '';
40+
3841
// HHVM support
3942
if (defined('HHVM_VERSION')) {
40-
return (getenv('PHP_BINARY') ?: PHP_BINARY).($includeArgs ? ' '.implode(' ', $this->findArguments()) : '');
43+
return (getenv('PHP_BINARY') ?: PHP_BINARY).$args;
4144
}
4245

4346
// PHP_BINARY return the current sapi executable
4447
if (defined('PHP_BINARY') && PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg')) && is_file(PHP_BINARY)) {
45-
return PHP_BINARY.($includeArgs ? ' '.implode(' ', $this->findArguments()) : '');
48+
return PHP_BINARY.$args;
4649
}
4750

4851
if ($php = getenv('PHP_PATH')) {

0 commit comments

Comments
 (0)