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 HTTP requests using curl with fallback to file stream #302

Merged
merged 12 commits into from
Feb 15, 2017

Conversation

gpressutto5
Copy link
Contributor

No description provided.

throw new \RuntimeException('allow_url_fopen must be enabled to use PHP streams.');
}
}
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Code by gravity. Use guard clauses and avoid if elseif pyramids.

Copy link
Contributor

@SparK-Cruz SparK-Cruz left a comment

Choose a reason for hiding this comment

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

Make requests great again!

$response = json_decode($response);
}
} else {
if(curl_errno($this->curl)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

There are a few weird responses that don't use 200, in case of api business rules validations.
The ignoredStatusCodes array was built to filter them out.

Copy link
Contributor

@SparK-Cruz SparK-Cruz left a comment

Choose a reason for hiding this comment

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

Make requests great again x2

@gpressutto5 gpressutto5 merged commit 220b7f5 into master Feb 15, 2017
@gpressutto5 gpressutto5 deleted the feature/curl branch February 15, 2017 17:50
@gpressutto5 gpressutto5 restored the feature/curl branch February 15, 2017 18:06
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