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

#465 use guzzle for http transport #618

Merged
merged 2 commits into from May 25, 2014
Merged

#465 use guzzle for http transport #618

merged 2 commits into from May 25, 2014

Conversation

milan
Copy link
Contributor

@milan milan commented May 22, 2014

Allow guzzle to be used as an optional transport

@milan
Copy link
Contributor Author

milan commented May 22, 2014

Out of memory issues on travis, it passed here: https://travis-ci.org/milan/Elastica/builds/25789973. Not sure if this can be rerun without another push, but give me a shout if there is anything you'd want to change anyway.

@ruflin
Copy link
Owner

ruflin commented May 23, 2014

I restarted the build. Looks good, but will have a deeper look into it during the weekend.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 8ac255b on milan:guzzle-transport into 58b0928 on ruflin:master.

* @param bool $persistent False if not persistent connection
* @return resource Connection resource
*/
protected function getGuzzleClient($baseUrl, $persistent = true)
Copy link
Owner

Choose a reason for hiding this comment

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

We use the naming convention with _ for protected functions

@ruflin
Copy link
Owner

ruflin commented May 24, 2014

What you added here is really nice. Can you also update the changes.txt file?

There is on thing that worries me. A lot of code in the http transport and the guzzle transport are the same. Shouldn't we either have a common base class or that Guzzle extends http and overwrites the functions needed? At the moment the problem is, if we fix something in one transport and forget also to copy it to the other, it will be broken.

@milan
Copy link
Contributor Author

milan commented May 25, 2014

I was thinking the same thing, but couldn't decide on an approach, I think at a high level they are the same, so would probably lean towards a base class with a concrete exec() function made up abstract methods that get extended by Http/Guzzle implementing just those abstract functions?

Could we create a new issue regarding the best approach to refactor this and I'll try and create a pull request with some refactored code once there is a set direction.

ruflin added a commit that referenced this pull request May 25, 2014
@ruflin ruflin merged commit 071f262 into ruflin:master May 25, 2014
@ruflin
Copy link
Owner

ruflin commented May 25, 2014

Ok, I merged this one in. Lets discuss this refactoring directly on a new issue. My problem is that Http sounds like the perfect name for the base class. How should we call it? HttpBase?

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.

None yet

3 participants