joomla / joomla-framework

[READ-ONLY] This repo is no longer in active development. Please see https://github.com/joomla-framework for the individual Framework packages.
http://framework.joomla.org
GNU General Public License v2.0
189 stars 140 forks source link

Investigate pulling HTTP Response handling into its own class #174

Open realityking opened 11 years ago

realityking commented 11 years ago

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)

dongilbert commented 11 years ago

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.

realityking commented 11 years ago

By Http do you mean you current Http package?

dongilbert commented 11 years ago

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?

realityking commented 11 years ago

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.