joomla-framework icon indicating copy to clipboard operation
joomla-framework copied to clipboard

Investigate pulling HTTP Response handling into its own class

Open realityking opened this issue 11 years ago • 4 comments

We should look into pulling HTTP Response handling into its own class. This will make it easier to use some of our libraries independently (I'm think about the OAuth classes in particular)

The CMS has a Response class (https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/environment/response.php), it was dropped from the platform because it relied completely on static methods.

Symfony2's Response class (main file is https://github.com/symfony/HttpFoundation/blob/master/Response.php) is kinda hovering over this discussion. Unfortunately it has a typehint to the Request class (however not a hard dependency)

realityking avatar Jun 03 '13 19:06 realityking

This would be very useful. Our OAuth classes take an application object just to handle sending a redirect, which really isn't ideal (or even necessary). Http should handle the response / redirect, IMO.

dongilbert avatar Jun 03 '13 20:06 dongilbert

By Http do you mean you current Http package?

realityking avatar Jun 03 '13 20:06 realityking

I think it should be part of a refactored Http package. Our current Http package is more for getting/posting remote data, don't you think?

dongilbert avatar Jun 03 '13 20:06 dongilbert

Right our currently one is an abstraction around curl/fopen/sockets. Maybe we should rename it but I wouldn't want to mix that with the abstraction for HTTP Response (and Request?) handling.

realityking avatar Jun 03 '13 20:06 realityking