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 request: Extract HTTP logic into a new class #80

Open
rossmotley opened this issue Aug 15, 2017 · 2 comments
Open

Feature request: Extract HTTP logic into a new class #80

rossmotley opened this issue Aug 15, 2017 · 2 comments

Comments

@rossmotley
Copy link
Contributor

I think it would be a good thing to extract the following two methods into a new $transport object, which implements some sort of interface:

\Sailthru_Client::httpRequestCurl
\Sailthru_Client::httpRequestWithoutCurl

This will make it easier to:

  • Unit test the Sailthru_Client class without resorting to partial mocks
  • Add logging or other implementations (Guzzle? Buzz?)

We could provide two implementations in this codebase, curl and streams, which don't have any other dependencies.

The interface could potentially make use of the PSR7:

http://www.php-fig.org/psr/psr-7/

@djmarland
Copy link

+1
Without this we currently have issues as we need to set proxies, and there is no way to inject a curl_setopt($ch, CURLOPT_PROXY, $proxy); as it currently stands

@silverman63
Copy link
Contributor

Hi all, as this is a bigger update, I can start to explore it, but can't put in this upcoming release. I'll look at our other clients that have HTTP broken out. Will reference the ticket + CC you both in the PR when we get there. @rossmotley will also look at the sketch in your fork.

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

No branches or pull requests

3 participants