cvs: pear /HTTP_Request Request.php package.xml

From: Date: Thu, 29 Apr 2004 13:15:29 +0000
Subject: cvs: pear /HTTP_Request Request.php package.xml
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-18938@lists.php.net to get a copy of this message
avb Thu Apr 29 09:15:29 2004 EDT Modified files: /pear/HTTP_Request Request.php package.xml Log: Implemented #526 and #1141 Prepare new release http://cvs.php.net/diff.php/pear/HTTP_Request/Request.php?r1=1.35&r2=1.36&ty=u Index: pear/HTTP_Request/Request.php diff -u pear/HTTP_Request/Request.php:1.35 pear/HTTP_Request/Request.php:1.36 --- pear/HTTP_Request/Request.php:1.35 Sat Apr 10 07:11:33 2004 +++ pear/HTTP_Request/Request.php Thu Apr 29 09:15:28 2004 @@ -32,7 +32,7 @@ // | Author: Richard Heyes <richard@phpguru.org> | // +-----------------------------------------------------------------------+ // -// $Id: Request.php,v 1.35 2004/04/10 11:11:33 avb Exp $ +// $Id: Request.php,v 1.36 2004/04/29 13:15:28 avb Exp $ // // HTTP_Request Class // @@ -43,8 +43,9 @@ // echo $a->getResponseBody(); // -require_once('Net/Socket.php'); -require_once('Net/URL.php'); +require_once 'PEAR.php'; +require_once 'Net/Socket.php'; +require_once 'Net/URL.php'; define('HTTP_REQUEST_METHOD_GET', 'GET', true); define('HTTP_REQUEST_METHOD_HEAD', 'HEAD', true); @@ -185,6 +186,18 @@ */ var $_saveBody = true; + /** + * Timeout for reading from socket (array(seconds, microseconds)) + * @var array + */ + var $_readTimeout = null; + + /** + * Options to pass to Net_Socket::connect. See stream_context_create + * @var array + */ + var $_socketOptions = null; + /** * Constructor * @@ -551,10 +564,13 @@ // If this is a second request, we may get away without // re-connecting if they're on the same server - if ( PEAR::isError($err = $this->_sock->connect($host, $port, null, $this->_timeout)) - OR PEAR::isError($err = $this->_sock->write($this->_buildRequest())) ) { + if (PEAR::isError($err = $this->_sock->connect($host, $port, null, $this->_timeout, $this->_socketOptions)) || + PEAR::isError($err = $this->_sock->write($this->_buildRequest()))) { - return $err; + return $err; + } + if (!empty($this->_readTimeout)) { + $this->_sock->setTimeout($this->_readTimeout[0], $this->_readTimeout[1]); } $this->_notify('sentRequest'); http://cvs.php.net/diff.php/pear/HTTP_Request/package.xml?r1=1.12&r2=1.13&ty=u Index: pear/HTTP_Request/package.xml diff -u pear/HTTP_Request/package.xml:1.12 pear/HTTP_Request/package.xml:1.13 --- pear/HTTP_Request/package.xml:1.12 Mon Oct 27 05:48:50 2003 +++ pear/HTTP_Request/package.xml Thu Apr 29 09:15:28 2004 @@ -25,29 +25,23 @@ </maintainers> <release> - <version>1.2</version> - <date>2003-10-27</date> + <version>1.2.1</version> + <date>2004-04-29</date> <state>stable</state> <license>BSD</license> <notes> -Feature additions: - * Support for multipart/form-data POST requests and file uploads (partly based on Christian Stocker's work) - * Brackets [] after array variables are optional (on by default, controlled by useBrackets parameter) - * HTTP_Request now implements a Subject-Observer design pattern. It is possible to add Listeners - to the Request object to e.g. draw a progress bar when downloading a large file. This is partly - based on Stefan Walk's work. A usage example for this is available. - -Migration to 1.2: - * Redirect support is now OFF by default - * Redirect support is DEPRECATED - * Methods clearCookies(), clearPostData(), reset() are DEPRECATED - +Additions and changes: + * Applied patch from #851 (First parameter of constructor is now optional) + * Implemented #526 (It is now possible to set timeout on socket, via + parameter readTimeout) + * Implemented #1141 (It is now possible to pass options to socket via + parameter socketOptions, Net_Socket 1.0.2 is needed for this functionality) + Fixes: - * Fixed PEAR bug #18 (Lowercased headers, fix by Dave Mertens) - * Fixed PEAR bug #131 (Domain without trailing slash) - * Fixed PHP bug #25486 (100 Continue handling) - * Fixed PEAR bug #150 (Notices being generated) - * Fixed problems with HTTP responses without bodies + * Fixed #842 (Doc comments incorrectly described the possible return values) + * Fixed #1152 (Incorrect handling of cookies with '=' in value) + * Fixed #1158 (Cookie parameters are not necessarily lowercase) + * Fixed #1080 (Cookies should not be urlencoded/urldecoded) </notes> <filelist> <dir name="/" baseinstalldir="HTTP"> @@ -63,12 +57,38 @@ </filelist> <deps> <dep type="pkg" rel="ge" version="1.0.7">Net_URL</dep> - <dep type="pkg" rel="ge" version="1.0">Net_Socket</dep> + <dep type="pkg" rel="ge" version="1.0.2">Net_Socket</dep> </deps> </release> <changelog> <release> + <version>1.2</version> + <date>2003-10-27</date> + <state>stable</state> + <license>BSD</license> + <notes> +Feature additions: + * Support for multipart/form-data POST requests and file uploads (partly based on Christian Stocker's work) + * Brackets [] after array variables are optional (on by default, controlled by useBrackets parameter) + * HTTP_Request now implements a Subject-Observer design pattern. It is possible to add Listeners + to the Request object to e.g. draw a progress bar when downloading a large file. This is partly + based on Stefan Walk's work. A usage example for this is available. + +Migration to 1.2: + * Redirect support is now OFF by default + * Redirect support is DEPRECATED + * Methods clearCookies(), clearPostData(), reset() are DEPRECATED + +Fixes: + * Fixed PEAR bug #18 (Lowercased headers, fix by Dave Mertens) + * Fixed PEAR bug #131 (Domain without trailing slash) + * Fixed PHP bug #25486 (100 Continue handling) + * Fixed PEAR bug #150 (Notices being generated) + * Fixed problems with HTTP responses without bodies + </notes> + </release> + <release> <version>1.1.1</version> <date>2003-01-30</date> <state>stable</state>

« previous php.pear.cvs (#18938) next »