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

Make Requests_Transport_cURL::stream_headers accessible #157

Closed
adri opened this issue May 7, 2015 · 2 comments · Fixed by #158
Closed

Make Requests_Transport_cURL::stream_headers accessible #157

adri opened this issue May 7, 2015 · 2 comments · Fixed by #158

Comments

@adri
Copy link
Contributor

adri commented May 7, 2015

While fixing this issue in php-vcr I noticed that a curl header function references the protected function Requests_Transport_cURL::stream_headers.

This works as long as the caller of the callback is in the same "class scope" but not when calling it from somewhere else like php-vcr does. When running the integration tests I get the following error:

Invalid callback Requests_Transport_cURL::stream_headers, cannot access protected method Requests_Transport_cURL::stream_headers()

When I make the method public, it works. Would you like to do this or would you prefer another way to allow for calling this method?

@ozh
Copy link
Collaborator

ozh commented May 7, 2015

(semi-related, sorry for hijacking: @rmccue, ditch 5.2 and use this neat PHP-VCR to solve the ongoing external HTTP request!!)

@adri
Copy link
Contributor Author

adri commented May 9, 2015

@ozh At the moment php-vcr can't intercept fsockopen or stream_socket_client, see the issue on php-vcr. Using php-vcr for Requests would work only for the cURL part. In theory "raw requests" can also be intercepted but I couldn't find the time yet to implement it.

Btw. PHP 5.3+ would only be necessary for running tests, not for the library itself.

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 a pull request may close this issue.

2 participants