-
-
Notifications
You must be signed in to change notification settings - Fork 342
Integration for HHVM Support #342
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
Conversation
This almost works, however support for the stream client is not currently working with hhvm, specifically due to it sending duplicate headers. The curl client is fine however, and all the other tests indicate it is stable. I've opened up #4030 in parse-server to entertain the idea of handling duplicate headers for api keys, tokens, etc. The alternative to that is to possibly wait for a new release of hhvm, or to try submitting a patch to address the issue there. |
Codecov Report
@@ Coverage Diff @@
## master #342 +/- ##
==========================================
- Coverage 98.67% 98.61% -0.07%
==========================================
Files 35 35
Lines 3164 3171 +7
==========================================
+ Hits 3122 3127 +5
- Misses 42 44 +2
Continue to review full report at Codecov.
|
For historical purposes I'm just going to mention what was done here. Turns out any header you pass to header when creating a new stream context will be duplicated in all observed cases (observed on hhvm 3.20). In order to get past this and add HHVM support I was dug into the http-stream-wrapper and found a nifty looking bit of c++ : if (opts.exists(s_user_agent) && !headers.exists(s_User_Agent)) {
headers.set(s_User_Agent, opts[s_user_agent]);
} From this it appeared that the Taking advantage of this I was able to append the custom headers after the $this->options['http']['user_agent'] = "parse-php-sdk\r\n".$this->buildRequestHeaders(); Turns out this works pretty well, and it's also something that can be done on php5, and probably up to 7 (but I wouldn't recommend it!). In this case it's strictly implemented to handle hhvm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great that we have that support now! Worth a blog post :)
Cool! just wanted to have another set of eyes check this over since it isn't exactly a standard approach. And yeah with HHVM this could open up a whole new realm of possibilities 👍 |
Is it a heavily requested feature? |
No I actually haven't heard anything about it in particular, just figured it would be good to add though. Especially considering how much more efficient it can be. Plus travis offers that ever so enticing |
This is an attempt to integrate official HHVM support for the parse-php-sdk. Only a couple test changes were needed to be made up front, but the underlying stream client seems to misbehave.
Given that full compatibility will be required for this to move along I'll be tweaking things here to see if I can get the full test suite (with the stream tests) to play nice with hhvm.