[Discussion] Why not PSR-15?


#1

I just started learning about middleware and noticed that cakePHP does not follow the PSR-15, although it does follow PSR-7.

Is there a strategic reason for this? Since middleware was introduced recently in 3.5.0 I wouldn’t think there are backwards compatibility issues.

I’m not criticizing or anything, more of a newbie question to understand the logic behind this. Maybe PSR-15 support is planned for the future?

Thanks :slight_smile:


#2

There isn’t a strategic reason. The PSR15 spec was finalized well after we had adopted PSR7 and the ‘two-pass’ middleware approach used by other frameworks using PSR7.

Supporting PSR15 is something I would like to do in the future. Right now PSR15 in isolation makes creating responses challenging as doing so requires coupling to a concrete response class. However, PSR17 can solve this.


#3

I see! Thanks for the clarification :slight_smile: