Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.1

Request #12322 add method allResposes()
Submitted: 2007-10-24 10:13 UTC Modified: 2008-10-11 09:32 UTC
From: cwiedmann Assigned: avb
Status: Closed Package: HTTP_Client (version 1.1.1)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2007-10-24 10:13 UTC] cwiedmann (Carsten Wiedmann)
Description: ------------ Hello, in this class there is a property _isHistoryEnabled, which defaults to TRUE, _maxRedirects also defaults to >0 (5). But there is no way to access this history. I can only access the last history entry with currentResponse(). It would be fine to have a method like: | /** | * Returns all HTTP responses | * | * @access public | * @return array | */ | function &allResponses() | { | return $this->_responses; | } Regards, Carsten

Comments

 [2008-10-10 16:42 UTC] avb (Alexey Borzov)
I thought about this idea for (quite) a while and decided I'd rather implement an iterator over the responses. Of course I cannot use 'implements Iterator' since it is a PHP4 package, but method names will be the same and those wishing to use it with foreach in PHP5 will only need to subclass.
 [2008-10-11 09:32 UTC] avb (Alexey Borzov)
Added methods to iterate over the received responses, the methods are essentially the same as in the Iterator interface.