Skip to content

Commit

Permalink
[Process] Fix trailing space in PHP binary finder
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Nov 19, 2015
1 parent b268a43 commit 4d0eaad
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions PhpExecutableFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ public function __construct()
*/
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')) {
Expand Down

0 comments on commit 4d0eaad

Please sign in to comment.