flightphp / core

An extensible micro-framework for PHP
https://docs.flightphp.com
MIT License
2.64k stars 407 forks source link

Maybe support PSR-7 interface in future? #423

Closed juneszh closed 9 months ago

n0nag0n commented 9 months ago

I'm curious what your use cases are for all you who have reacted to this. If there was a PSR-7 interface, what would you actually do with it? @rdkempt @bvfbarten @pierresh @evansharp @CodeAlDente @tiagoon

CodeAlDente commented 9 months ago

So, this is a bit old, but as far as I recall, I was trying to find a simple way to grab and adjust headers. It would also cut down on extra lines of code for functions like Flight::etag.

n0nag0n commented 9 months ago

So at least in your case @CodeAlDente it wasn't to integrate with other plugins in the world, just easier header/body manipulation?

CodeAlDente commented 9 months ago

Yep, exactly.

n0nag0n commented 9 months ago

So looking more into this, into header manipulation that seems to be ok with what's already in the framework. You can set headers, collect headers, and now with middleware you can collect the response() and evaluate/manipulate the headers in the way you need. You also can evaluate what is in the body (if your script is actually using $this->response()->write()) I'm going to close this for now.