[Process] Fix trailing space in PHP binary finder

This commit is contained in:
Nicolas Grekas 2015-11-19 13:33:23 +01:00
parent a05e73fa47
commit f15e6e0ba9
1 changed files with 5 additions and 2 deletions

View File

@ -35,14 +35,17 @@ class PhpExecutableFinder
*/
public function find($includeArgs = true)
{
$args = $this->findArguments();
$args = $includeArgs && $args ? ' '.implode(' ', $args) : '';
// HHVM support
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
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')) {