Skip to content
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

Fixed php7 build using wrapper for curl_getinfo #868

Merged
merged 5 commits into from
Jun 3, 2015

Conversation

im-denisenko
Copy link
Contributor

Was discussed here: #861 (comment)

@im-denisenko
Copy link
Contributor Author

All is green! :)

@@ -197,6 +197,6 @@ public static function convertRequestToCurlCommand(Request $request)
*/
public static function debugEnabled()
{
return defined('DEBUG') && DEBUG;
return defined('ELASTICA_DEBUG') && ELASTICA_DEBUG;
Copy link
Owner

Choose a reason for hiding this comment

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

I didn't rename the constant on purpose as this will break BC. If we change it, it must be mentioned as BC break in the CHANGELOG. I suggest we change it as I think in the long term it makes more sense to have it in the namespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, haven't thought if this is BC. In that case, I would suggest to remove this ELASTICA_DEBUG completely, because debug should be an parameter of connection constructor and not some magic constant.

Copy link
Owner

Choose a reason for hiding this comment

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

Agree. I'm not even sure if "debug" is the correct name. Perhaps it is more "verbose" or something like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Though, only difference I see between "debug mode" and not "debug mode" is just two things:

  • Would $response->setQueryTime be invoked after request.
  • Would curl option CURLINFO_HEADER_OUT be applied or not.

Both of them has no impact on performance, is this really worth to keep debug option?

Copy link
Owner

Choose a reason for hiding this comment

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

I remember it was more a memory issue then a performance issue. CURLINFO_HEADER_OUT returns the full string as part of the response object. If you use bulk mode this can add up to quite a large object. CURLINFO_HEADER_OUT could also be set through the curl options.

The query time part should not have an affect and I think this is what is mostly needed.

Best would be to active the benchmark tests to see if there is a difference. They should work now again but are not enabled for travis.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They should work

I tried, but they don't.

Then I would like to remove this constant. One who want to get headers in response could pass CURLINFO_HEADER_OUT via curl options.

@ruflin
Copy link
Owner

ruflin commented Jun 2, 2015

👍 Can you update the CHANGELOG?

- Response::getQueryTime is always available now.
- Use 'curl' parameter of Transport\Http to specify option CURLINFO_HEADER_OUT=true, if you want to have "request_header" key in Response::getTransferInfo
@im-denisenko
Copy link
Contributor Author

@ruflin Changelog updated, debug removed, bc break mentioned.

ruflin added a commit that referenced this pull request Jun 3, 2015
Fixed php7 build using wrapper for curl_getinfo
@ruflin ruflin merged commit b5b0561 into ruflin:master Jun 3, 2015
@ruflin
Copy link
Owner

ruflin commented Jun 3, 2015

Thx. Nice one as complexity reduced. We could mention in the CHANGELOG more specific that the curl params now must be used.

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

Successfully merging this pull request may close these issues.

2 participants