-guzzle has its own implementation ref. https://github.com/guzzle/guzzle
ref. https://mwop.net/blog/2015-01-08-on-http-middleware-and-psr-7.html
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/710eaff2-3bd5-4927-9b13-80b91f6e81ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CALphBcvp4%2BZhmjixTQL%3DB%2BBDBzkze9t1XwJC9Ro4UEB-D5YCLg%40mail.gmail.com.
--
You received this message because you are subscribed to a topic in the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/php-fig/Ew36Ng5EwXE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAGOJM6%2Bx4uCV5m9kG0FXyfUqU29bbJYJ%2BG0PWDGRMZAd9HrwkA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CALphBcuDkBkKMA_r%3DmLsFwnR08nkxQg085_Ht%3DGsWNUWXePuOg%40mail.gmail.com.
On Sep 11, 2015 1:36 PM, "Woody Gilk" <woody...@gmail.com> wrote:
>
> These interfaces are incorrect.
Who made you the arbiter of correct and incorrect?
The interfaces I provided in my post all exist, are documented, and are widely used. None is more correct than any other; they offer different capabilities and arose out of different needs.
> There is only one signature, and it is:
>
> public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next) : ResponseInterface
This is the signature originally developed in Connect, and later adopted in Conduit (which became Stratigility), Relay, and Slim 3. It is not the *one* and *only* signature, as I pointed out previously. Stack and Lumen have other signatures, which are equally capable, and other signatures also exist.
> To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAGOJM6%2Bx4uCV5m9kG0FXyfUqU29bbJYJ%2BG0PWDGRMZAd9HrwkA%40mail.gmail.com.
The interfaces I provided in my post all exist, are documented, and are widely used. None is more correct than any other; they offer different capabilities and arose out of different needs.
...
Who made you the arbiter of correct and incorrect?
On Sep 11, 2015 6:04 PM, "Woody Gilk" <woody...@gmail.com> wrote:
>
> On Fri, Sep 11, 2015 at 5:55 PM, Matthew Weier O'Phinney <mweiero...@gmail.com> wrote:
>>
>> The interfaces I provided in my post all exist, are documented, and are widely used. None is more correct than any other; they offer different capabilities and arose out of different needs.
>>
>> ...
>>
>> Who made you the arbiter of correct and incorrect?
>
>
> Then let me be more clear...
>
> These interfaces are incorrect because:
>
> 1. they use a reference for & $response, which is going to be wrong no matter what the interface is.
I believe we may be talking about different things, then. Which interfaces are you referring to, exactly? In my original post on this thread, I referenced WSGI, Rack, Node, and Connect. What are you referring to?
> A major point of immutability in PSR-7 is avoidance of side effects and forcing the usage of a reference is exactly the opposite of avoiding side effects.
You don't need to lecture me on PSR-7; I was editor of the proposal.
> 2. Having an addNext method implies things that are not absolutely true:
This statement tells me you're talking about something I've not seen; can you link to where you're seeing this method? I clearly missed something along the way, and I'm not seeing it in this thread.
> 2.1. that the only viable middleware container is one that is not immutable
> 2.2. that the exact order of the interfaces will be preserved, no matter what other methods exist
> 2.3. extending from the middleware interface is a given
>
> As per previous discussions, I think that Relay was the first
Relay followed the lead of Stratigility (née Conduit), which is a port of Connect. I bring this up to ensure the history is clear; i.e., it's an established pattern used elsewhere, and tested in production applications in other languages.
> (or one of) to definite an interface for PSR-7 middleware and we should consider it the canonical signature _for PSR-7_.
Why?
Granted, I've clearly implemented the same signature in projects I've authored. However, the fact is that other patterns are equally established and production-tested (Stack is used all over the place; Lumen is gaining traction; etc.). What makes *this* *one* more viable than others? Just asserting it doesn't make it so.
Also, the fact that it might be the first used by dedicated psr-7 libraries doesn't make it better in and of itself. You can easily use psr-7 instances in any of the other established patterns just as well.
My point is: make clear arguments detailing why the pattern is the *single* one that should be proposed. While I personally prefer this pattern, I can see clear merits in the others as well. I think strong cases will be necessary if you want to persuade users of other patterns.
I also think it's acceptable to acknowledge all of the patterns in such a specification, and would argue that doing so is more likely to achieve consensus. Standards (outside of FIG) have done similarly where warranted.
Arguing that a single one is the only "correct" approach is polarizing, if you cannot make a strong case based on technical merits.
>
> --
> Woody Gilk
> http://about.me/shadowhand
>
> --
> You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
> To post to this group, send email to php...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAGOJM6Jb%3DO3j%2BuNtuROLqoNrGFC6zAyrK1Gf8up%3D5_Ps_TM_VQ%40mail.gmail.com.
1. they use a reference for & $response, which is going to be wrong no matter what the interface is. A major point of immutability in PSR-7 is avoidance of side effects and forcing the usage of a reference is exactly the opposite of avoiding side effects.
2. Having an addNext method implies things that are not absolutely true:
2.3. extending from the middleware interface is a given
As per previous discussions, I think that Relay was the first (or one of) to definite an interface for PSR-7 middleware and we should consider it the canonical signature _for PSR-7_.
--
You received this message because you are subscribed to a topic in the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/php-fig/Ew36Ng5EwXE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAGOJM6Jb%3DO3j%2BuNtuROLqoNrGFC6zAyrK1Gf8up%3D5_Ps_TM_VQ%40mail.gmail.com.