GithubHelp home page GithubHelp logo

Guzzle? about ziptastic-php HOT 10 CLOSED

ziptastic avatar ziptastic commented on June 5, 2024
Guzzle?

from ziptastic-php.

Comments (10)

jdpedrie avatar jdpedrie commented on June 5, 2024

It's such a simple library that I didn't want to require a heavy dependency like Guzzle. Also, there's a fair bit of fragmentation in guzzle usage. People use guzzle 5 or 6 (or even 4 sometimes), so to use guzzle and not lock people out, I'd need to write separate implementations of ServiceInterface for each incompatible version of Guzzle.

I think guzzle implementations of the ServiceInterface would be a good idea, but unless there is actual demand for it I think simple curl covers what is needed.

from ziptastic-php.

austinkregel avatar austinkregel commented on June 5, 2024

The only reason I mention it is that I can see a LOT of people using this for projects that already have a library. The packages and frameworks I use on a daily basis already require Guzzle and for me it would be unneeded to have a custom cURL client. I'll try and put something together for a Guzzle version of this :)

from ziptastic-php.

jdpedrie avatar jdpedrie commented on June 5, 2024

It isn't a custom curl client. Guzzle is a custom curl client. This just uses curl directly instead of through a library.

from ziptastic-php.

jdpedrie avatar jdpedrie commented on June 5, 2024

That isn't to say you can't write a guzzle client. Feel free. Just make sure you keep full test coverage.

from ziptastic-php.

daspecster avatar daspecster commented on June 5, 2024

Yeah, so I think if we did a guzzle version it should be in it's own repo. Not having dependencies is a pretty strong feature in itself.

@austinkregel let me know if you want to and I can make another repo.

from ziptastic-php.

jdpedrie avatar jdpedrie commented on June 5, 2024

Nah, I don't think you'd need a separate repo:

| - src/Service/CurlService.php
| - src/Service/Guzzle4Service.php
| - src/Service/Guzzle5Service.php
| - src/Service/Guzzle6Service.php

Then people could use the Lookup class with whichever service corresponds to the version of guzzle they're already using.

from ziptastic-php.

jdpedrie avatar jdpedrie commented on June 5, 2024

You need different classes because the implementation between major versions breaks BC.

from ziptastic-php.

daspecster avatar daspecster commented on June 5, 2024

Oh nice! The power of abstraction!
So I know @jdpedrie and I have been talking on gchat about how to handle the guzzle dependency, so I think there's some issues there.

Also, would having a separate ziptastic-php-guzzle being available through composer actually help people get what they're looking for? i.e. stripped down ziptastic-php for their non guzzled projects and ziptastic-php-guzzle for people already using guzzle?

from ziptastic-php.

jdpedrie avatar jdpedrie commented on June 5, 2024

I don't think that is necessary. And it doesn't solve the incompatible API versions problem either. I think you'd see better results from what I suggested above.

All that said... I don't think people would need to bother unless they've got a really weird situation. The CurlService that's already provided is zero-configuration and no added overhead. The only added benefit of using guzzle (even if you're already using guzzle for everything else) is if you want to inject something into the request or response.

from ziptastic-php.

daspecster avatar daspecster commented on June 5, 2024

Ok cool, yeah I defer to your judgement.
Should we make this a feature or make a new issue that's a feature?
I don't have any kind of process defined for this yet haha.

from ziptastic-php.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.