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

Feature: use curl (or whatever else) as HttpAdapter #675

Open
wants to merge 22 commits into
base: v3-v2021-02-25
Choose a base branch
from

Conversation

SinusPi
Copy link

@SinusPi SinusPi commented Mar 18, 2022

Added curl as a more configurable HTTP connection library.

(Includes: saas786's HttpAdapterInterface patch, plus HEAD request validity check patch. May not need the latter.)

Primary improvement: if curl fails to connect, it throws a \Recurly\ConnectionError with all of its curl_getinfo in it, ready for implementing possible retries, network outage reports, etc.
Before: if file_get_contents fails to connect, it emits a PHP Warning in text and returns an empty response, with not a lot of error-handling possible.

A test case verifies curl's connection abilities, using live API (obviously impure; enable test with an env var if needed).

saas786 and others added 22 commits September 28, 2021 18:04
- Base client class now accepts Http Adapter object as param.
- Add http adapter interface
… into v3-v2021-02-25:

- Added HttpAdapterInterface
…/guzzle' into v3-v2021-02-25:"

This reverts commit e20809e, reversing
changes made to d62bdf2.
…t-Type: application/json" was received in header.
so that makeRequest AND pagerCount are validated.
… because toResource no longer throws errors - makeRequest does.
…yError, just a ConnectionError that inherits \Error, bearing full curlinfo inside.
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