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

PHP warning when file_get_contents gets a non 200 response #5

Closed
jamieburchell opened this issue Feb 13, 2017 · 5 comments
Closed

PHP warning when file_get_contents gets a non 200 response #5

jamieburchell opened this issue Feb 13, 2017 · 5 comments

Comments

@jamieburchell
Copy link
Contributor

I'm wondering if this warning can/should be suppressed given the response error message is checked and an exception is thrown. One method might simply be to prefix the call with a gasp @ symbol.

I noticed cURL is used for POST but not GET; perhaps more control would be had using cURL for GET too?

@jabranr
Copy link
Owner

jabranr commented Feb 14, 2017

@jamieburchell Thank you for pointing it out. I did not put @ in front it intentionally so to not have it failed silently. Could you please provide an example to reproduce this failure?

@jamieburchell
Copy link
Contributor Author

H!, yes simply call for example the find method with an invalid postcode. If error reporting and display errors are configured you should see a PHP warning. In production at least this could mean a PHP warning in the logs for something which you are already handling as an error by checking the response. I'm not saying I'm right, just to me the warning seems pointless here.

@jamieburchell
Copy link
Contributor Author

Also if you do switch to a package such as Guzzle you have more flexibility. For anyone who doesn't support remote file_get_contents for example.

@jabranr
Copy link
Owner

jabranr commented Oct 7, 2022

Closing this as it will be addressed in other issues.

@jabranr jabranr closed this as completed Oct 7, 2022
@jabranr
Copy link
Owner

jabranr commented Oct 7, 2022

Partially related to #9

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

No branches or pull requests

2 participants