Skip to content

Commit

Permalink
Merge remote branch 'pborreli/windows-fix-process'
Browse files Browse the repository at this point in the history
* pborreli/windows-fix-process:
  [Process] Better guess of php bin executable path
  [Process] Removed useless getenv
  • Loading branch information
fabpot committed Mar 27, 2011
2 parents a294024 + ef447dc commit 33456e6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Symfony/Component/Process/PhpProcess.php
Expand Up @@ -78,8 +78,8 @@ public function run($callback = null)
*/
private function getPhpBinary()
{
if (getenv('PHP_PATH')) {
if (!is_executable($php = getenv('PHP_PATH'))) {
if ($php = getenv('PHP_PATH')) {
if (!is_executable($php)) {
throw new \RuntimeException('The defined PHP_PATH environment variable is not a valid PHP executable.');
}

Expand All @@ -93,6 +93,12 @@ private function getPhpBinary()
}
}

if ($php = getenv('PHP_PEAR_PHP_BIN')) {
if (is_executable($php)) {
return $php;
}
}

throw new \RuntimeException('Unable to find the PHP executable.');
}
}

0 comments on commit 33456e6

Please sign in to comment.