8000 Add support for HHVM in the getting of the PHP executable by JoelMarcey · Pull Request #9583 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Add support for HHVM in the getting of the PHP executable #9583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Add support for HHVM in the getting of the PHP executable #9583

wants to merge 2 commits into from

Conversation

JoelMarcey
Copy link
Contributor

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.

@romainneutron
Copy link
Contributor

This PR should be opened against 2.2, not master

@vicb
Copy link
Contributor
vicb commented Dec 20, 2013

@JoelMarcey that's great to see HHVM support, thanks !

@@ -33,6 +33,11 @@ public function __construct()
*/
public function find()
{
// HHVM support
if (($hhvm = getenv("PHP_BINARY")) !== false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the coding standard as @hhamon suggested.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a check on defined('HHVM_VERSION') should be added, to avoid checking this env variable on non-HHVM setup (where the PHP_BINARY constant should have precedence).

@fabpot
Copy link
Member
fabpot commented Dec 29, 2013

closing in favor of #9882

@fabpot fabpot closed this Dec 29, 2013
fabpot added a commit that referenced this pull request Dec 29, 2013
…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
@JoelMarcey
Copy link
Contributor Author

Thanks all for the code update and getting this into master.

cc: @ptarjan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0