8000 bug #9882 Add support for HHVM in the getting of the PHP executable (… · symfony/symfony@83eea20 · GitHub
[go: up one dir, main page]

Skip to content

Commit 83eea20

Browse files
committed
bug #9882 Add support for HHVM in the getting of the PHP executable (fabpot)
This PR was merged into the 2.3 branch. Discussion ---------- Add support for HHVM in the getting of the PHP executable | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Same as #9583 but with CS fixed, on 2.3, and with an added safeguard to only change the current behavior for HHVM. Check for a PHP_BINARY environment variable before using the pre-defined PHP_BINARY constant. HHVM has an explicit hhvm binary and a wrapper to mimic php functionality. We were running into issues with tests that ran in their own process where using the hhvm binary does not handle php code sent to it via stdin very well. We get "Nothing to do...pass file" exceptions. Unfortunately, the PHP_BINARY is always set to the explicit binary (the php wrapper is basically a symlink to the explicit binary). So, we thought about adding a check for a PHP_BINARY environment variable as the first choice when getting the PHP binary. Commits ------- 876482f [Process] fixed HHVM support 539de17 Add support for HHVM in the getting of the PHP executable
2 parents a1ae703 + 876482f commit 83eea20

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Process/PhpExecutableFinder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ public function __construct()
3333
*/
3434
public function find()
3535
{
36+
// HHVM support
37+
if (defined('HHVM_VERSION') && false !== $hhvm = getenv('PHP_BINARY')) {
38+
return $hhvm;
39+
}
40+
3641
// PHP_BINARY return the current sapi executable
3742
if (defined('PHP_BINARY') && PHP_BINARY && ('cli' === PHP_SAPI) && is_file(PHP_BINARY)) {
3843
return PHP_BINARY;

0 commit comments

Comments
 (0)
0