Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    David de Boer
    I think that only works with InternalRequests, but PSR-7 requests have no cookies.
    (well the server reqs do, but we need client reqs)
    Márk Sági-Kazár
    I think the InternalRequest only used because all requests are converted into internal requests in ivory
    If we can make a solution which is PSR-7 and not HTTP Client specific, that would be better I think
    David de Boer
    Agreed, but the adapters will always be client-specific, so cookies need to be passed into them somehow. I think the options make sense, that’s what Guzzle does, too.
    Márk Sági-Kazár
    @ddeboer I checked the guzzle implementation and at some point it simply serializes the cookie jar and places it in the request (which means it is not really guzzle specific)
    I think options should be used only for configurations which cannot be passed otherwised (eg. coded in header, like cookies)
    An event dispatcher solution is better IMO because you can use the same strategy for ALL adapters
    the event dispatcher adapter is a regular adapter which wraps another and emits events during it's lifecycle
    I am not completely happy with that solution though
    so I am thinking about implementing a plugin adapter
    which could utilize a similar middleware architecture to what I did it in port
    Márk Sági-Kazár
    my main problem with an event-driven solution is that PSR-7 messages are immutable, thus in every listener I would have to set the request/response in the event if I modify it
    in a middleware architecture it is not a problem
    the other ugly solution would be using decorators
    which is similar
    but that would be ugly as well
    new AuthAdapter(new CookieAdapter(new WhateverAdapter(new Guzzle6Adapter))))
    (new PluginAdapter(new Guzzle6Adapter))
    ->add(function($request) { //do something return $response; })
    or we can also introduce an interface for it
    @ddeboer I think your fear is that it does not work with an adapter out of the box, you need some sort of extra dependencies. Am I right?
    But I think we should keep adapter logic as minimal as possible
    Eric GELOEN
    Hey folks! I'm currently bootstraping the php-http/zend2-adapter package and I have some questions:
    I see the guzzle6 adapter relies on PHPUnit tests whereas I remember seing some PHPSpec tests. So, which one should I take?
    Márk Sági-Kazár
    Hey @egeloen
    Not sure if you noticed, but we moved to Slack
    As for the tests
    integration tests are written using phpunit
    Eric GELOEN
    hey! will move as well so. For my question, I have figure it out, don't worry!
    Jochen Manz
    Hi, currently looking into httplug and i wonder, is there a rate limiter plugin out there? The Api i have to access returns rate limit infos in the response header of each request