minor #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 | #16598
| License | MIT
| Doc PR | -
Commits
-------
f15e6e0
[Process] Fix trailing space in PHP binary finder
This commit is contained in:
commit
1728dcca82
|
@ -35,14 +35,17 @@ class PhpExecutableFinder
|
||||||
*/
|
*/
|
||||||
public function find($includeArgs = true)
|
public function find($includeArgs = true)
|
||||||
{
|
{
|
||||||
|
$args = $this->findArguments();
|
||||||
|
$args = $includeArgs && $args ? ' '.implode(' ', $args) : '';
|
||||||
|
|
||||||
// HHVM support
|
// HHVM support
|
||||||
if (defined('HHVM_VERSION')) {
|
if (defined('HHVM_VERSION')) {
|
||||||
return (getenv('PHP_BINARY') ?: PHP_BINARY).($includeArgs ? ' '.implode(' ', $this->findArguments()) : '');
|
return (getenv('PHP_BINARY') ?: PHP_BINARY).$args;
|
||||||
}
|
}
|
||||||
|
|
||||||
// PHP_BINARY return the current sapi executable
|
// PHP_BINARY return the current sapi executable
|
||||||
if (defined('PHP_BINARY') && PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg')) && is_file(PHP_BINARY)) {
|
if (defined('PHP_BINARY') && PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg')) && is_file(PHP_BINARY)) {
|
||||||
return PHP_BINARY.($includeArgs ? ' '.implode(' ', $this->findArguments()) : '');
|
return PHP_BINARY.$args;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($php = getenv('PHP_PATH')) {
|
if ($php = getenv('PHP_PATH')) {
|
||||||
|
|
Reference in New Issue