Re: PEAR2_Http_Request / HTTP_Request2

From: Date: Wed, 19 Sep 2007 19:49:26 +0000
Subject: Re: PEAR2_Http_Request / HTTP_Request2
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-48087@lists.php.net to get a copy of this message
Joshua Eichorn wrote:
The todo list for the code is: Write Curl/pecl_http adapters Update examples to use autoloader Write unit tests I don't have experience with curl og pecl_http, but if you need help with the stream or socket adapters, I'd be happy to help.
Also I'd like to help writing unit tests. Please show an example of how you would like these tests to be implemented - are you using PHPUnit? I think it would be preferable if the tests could run against a specially crafted PHP script that would be included in the test suite and installed on some server. I'd like to offer a code review when you are ready. Suggestion 1: The old HTTP_Request allowed to seperate timeout values, $request->timeout (the maximum execution time for the fsockopen() call) and $request->readTimeout (an array (!) specifying the maximum execution time for each of the many calls to fread()). I think it would be useful to allow the user to specify the maximum execution time of $request->sendRequest(). I don't know when the other two are relevant. Suggestion 2: In order to support downloading of very large files (files that cannot fit in memory) I suggest adding the possibility of saving the body to a file (e.g. $response->downloadToFile($filename)) or reading it through a stream wrapper (e.g. $response->getStream()). Christian

« previous php.pear.dev (#48087) next »