Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Document "connect" and "disconnect" events

Move to package.xml 2.0
Prepare release 1.4.0


git-svn-id: http://svn.php.net/repository/pear/packages/HTTP_Request/trunk@222368 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
commit 960b4384f9977368bdaefcb9076b65ffd3a89ff8 1 parent f114ce6
@sad-spirit sad-spirit authored
Showing with 319 additions and 203 deletions.
  1. +8 −5 Request.php
  2. +0 −198 package.xml
  3. +311 −0 package2.xml
View
13 Request.php
@@ -990,12 +990,15 @@ function detach(&$listener)
* Notifies all registered listeners of an event.
*
* Events sent by HTTP_Request object
- * 'sentRequest': after the request was sent
+ * - 'connect': on connection to server
+ * - 'sentRequest': after the request was sent
+ * - 'disconnect': on disconnection from server
+ *
* Events sent by HTTP_Response object
- * 'gotHeaders': after receiving response headers (headers are passed in $data)
- * 'tick': on receiving a part of response body (the part is passed in $data)
- * 'gzTick': on receiving a gzip-encoded part of response body (ditto)
- * 'gotBody': after receiving the response body (passes the decoded body in $data if it was gzipped)
+ * - 'gotHeaders': after receiving response headers (headers are passed in $data)
+ * - 'tick': on receiving a part of response body (the part is passed in $data)
+ * - 'gzTick': on receiving a gzip-encoded part of response body (ditto)
+ * - 'gotBody': after receiving the response body (passes the decoded body in $data if it was gzipped)
*
* @param string Event name
* @param mixed Additional data
View
198 package.xml
@@ -1,198 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<package xmlns="http://pear.php.net/dtd/package-1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://pear.php.net/dtd/package-1.0 http://pear.php.net/dtd/package-1.0.xsd"
- version="1.0">
-
- <name>HTTP_Request</name>
- <summary>Provides an easy way to perform HTTP requests</summary>
- <description>
-Supports GET/POST/HEAD/TRACE/PUT/DELETE, Basic authentication, Proxy,
-Proxy Authentication, SSL, file uploads etc.
- </description>
-
- <maintainers>
- <maintainer>
- <user>richard</user>
- <name>Richard Heyes</name>
- <email>richard@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>avb</user>
- <name>Alexey Borzov</name>
- <email>avb@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
-
- <release>
- <version>1.3.0</version>
- <date>2005-11-06</date>
- <license>BSD</license>
- <state>stable</state>
- <notes>
-* All request and response headers are now treated case-insensitively,
- per RFC 2616 (bug #1045, bug #4367).
-* Values of multiple response headers with the same name are combined
- into a comma-separated string per RFC 2616 (bug #1045)
-* Generate proper closing boundary for multipart/form-data requests,
- per RFC 1521 (bug #4397)
-* magic_quotes_runtime directive is switched off when performing the
- request since it may break file uploads and chunked responses (bug #4543)
-* Response::_readChunked() will finish on zero-length chunk rather than
- socket eof (patch from bug #3037)
-* Added HTTP_Request::setBody() method, deprecated addRawPostData() due to
- misleading name. The request body will be sent with all request methods
- except those that explicitly forbid this (e.g. TRACE). Data set via
- addPostData() / addFile() will only be sent with POST (see request #4716)
- </notes>
- <deps>
- <dep type="pkg" rel="ge" version="1.0.12">Net_URL</dep>
- <dep type="pkg" rel="ge" version="1.0.2">Net_Socket</dep>
- </deps>
- <filelist>
- <dir name="/" baseinstalldir="HTTP">
- <file role="php" name="Request.php" />
- <dir name="Request">
- <file role="php" name="Listener.php" />
- </dir>
- <dir name="docs" role="doc">
- <file role="doc" name="example.php" />
- <file role="doc" name="download-progress.php" />
- </dir>
- </dir>
- </filelist>
- </release>
-
- <changelog>
- <release>
- <version>1.2.4</version>
- <date>2004-12-30</date>
- <license>BSD</license>
- <state>stable</state>
- <notes>
-* Notice was raised when processing a response containing secure
- cookies (bug #2741)
-* Warning was raised when processing a response with empty body and
- chunked Transfer-encoding (bug #2792)
-* Improved inline documentation on constructor parameters (bug #2751)
- </notes>
- </release>
- <release>
- <version>1.2.3</version>
- <date>2004-10-01</date>
- <license>BSD</license>
- <state>stable</state>
- <notes>
-* Auth information is properly extracted from URLs of the form http://user:pass@host/
- (bug #1507)
-* Connection to server is closed after performing request (bug #1692)
-* Use correct argument separator for generated query stings (bug #1857, see
- also bug #704 for Net_URL)
-* Do not use gzip encoding if certain string functions are overloaded by
- mbstring extension (bug #1781)
-* addPostData() now properly handles multidimensional arrays (bug #2233)
- </notes>
- </release>
- <release>
- <version>1.2.2</version>
- <date>2004-05-19</date>
- <license>BSD</license>
- <state>stable</state>
- <notes>
-Bug fixes:
-* Fixed #1037 (unable to connect to port 80 through HTTPS). This relies
- on fix for Net_URL bug #1036, thus Net_URL 1.0.12 is now required.
-* Fixed #1333 (sending POST data on non-POST requests).
-* Fixed #1433 (overwriting the variable name when adding multiple files
- for upload).
- </notes>
- </release>
- <release>
- <version>1.2.1</version>
- <date>2004-04-29</date>
- <license>BSD</license>
- <state>stable</state>
- <notes>
-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 #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>
- </release>
- <release>
- <version>1.2</version>
- <date>2003-10-27</date>
- <license>BSD</license>
- <state>stable</state>
- <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>
- <license>BSD</license>
- <state>stable</state>
- <notes>Added redirect support. Net_URL 1.0.7 is now required.</notes>
- </release>
-
- <release>
- <version>1.1.0</version>
- <date>2003-01-20</date>
- <license>BSD</license>
- <state>stable</state>
- <notes>Added SSL support as long as you have PHP 4.3.0+ and the OpenSSL extension. Net_URL 1.0.6 is now required.</notes>
- </release>
-
- <release>
- <version>1.0.2</version>
- <date>2002-09-16</date>
- <license>BSD</license>
- <state>stable</state>
- <notes>Added cookie support</notes>
- </release>
-
- <release>
- <version>1.0.1</version>
- <date>2002-07-27</date>
- <license>BSD</license>
- <state>stable</state>
- <notes>License change</notes>
- </release>
-
- <release>
- <version>1.0</version>
- <date>2002-02-17</date>
- <license>PHP License</license>
- <state>stable</state>
- <notes>Initial release of the HTTP_Request package.</notes>
- </release>
- </changelog>
-</package>
View
311 package2.xml
@@ -0,0 +1,311 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package packagerversion="1.4.11" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
+http://pear.php.net/dtd/tasks-1.0.xsd
+http://pear.php.net/dtd/package-2.0
+http://pear.php.net/dtd/package-2.0.xsd">
+ <name>HTTP_Request</name>
+ <channel>pear.php.net</channel>
+ <summary>Provides an easy way to perform HTTP requests</summary>
+ <description>Supports GET/POST/HEAD/TRACE/PUT/DELETE, Basic authentication, Proxy,
+Proxy Authentication, SSL, file uploads etc.
+
+ </description>
+ <lead>
+ <name>Richard Heyes</name>
+ <user>richard</user>
+ <email>richard@php.net</email>
+ <active>no</active>
+ </lead>
+ <lead>
+ <name>Alexey Borzov</name>
+ <user>avb</user>
+ <email>avb@php.net</email>
+ <active>yes</active>
+ </lead>
+ <date>2006-10-25</date>
+ <version>
+ <release>1.4.0</release>
+ <api>1.4.0</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
+ <notes>
+* Added Keep-Alive support (request #4806), thanks to Justin Patrin for the
+ initial patch. Please note that &quot;Connection: close&quot; header is still added
+ by default, you need to explicitly add &quot;Connection: Keep-Alive&quot; header or
+ remove &quot;Connection&quot; header if using HTTP 1.1
+* A new disconnect() method was added which forces disconnection from the
+ server if Keep-Alive is used. Also two new events are sent to the Listeners:
+ &quot;connect&quot; and &quot;disconnect&quot;
+* Added getUrl() method (request #6589)
+* Added method to properly parse header of gzip-encoded data (see RFC 1952).
+ This takes care of situations when the server adds some additional data
+ to the header (bug #8245) or sends data that is not gzip-encoded when
+ &quot;Content-Encoding: gzip&quot; header is present (bug #8213)
+* &quot;Proxy-Authorization&quot; header is now properly set by constructor
+ (bug #5913)
+* Fixed doc comments mentioning addBody() method instead of proper setBody()
+ (bug #5969)
+* Fixed erroneous removal of &quot;Content-Type&quot; header from request
+ (bug #7922)
+* Bogus HTTP headers are now ignored (bug #8214)
+* Path is set to &quot;/&quot; if an URL without path (http://www.example.com)
+ is given (bug #8662)
+* Moved to package.xml version 2.0
+ </notes>
+ <contents>
+ <dir name="/">
+ <dir name="docs">
+ <file baseinstalldir="HTTP" name="download-progress.php" role="doc"/>
+ <file baseinstalldir="HTTP" name="example.php" role="doc"/>
+ </dir>
+ <dir name="Request">
+ <file baseinstalldir="HTTP" name="Listener.php" role="php"/>
+ </dir>
+ <file baseinstalldir="HTTP" name="Request.php" role="php"/>
+ </dir>
+ </contents>
+ <dependencies>
+ <required>
+ <php>
+ <min>4.0.0</min>
+ </php>
+ <pearinstaller>
+ <min>1.4.0b1</min>
+ </pearinstaller>
+ <package>
+ <name>Net_URL</name>
+ <channel>pear.php.net</channel>
+ <min>1.0.12</min>
+ </package>
+ <package>
+ <name>Net_Socket</name>
+ <channel>pear.php.net</channel>
+ <min>1.0.2</min>
+ </package>
+ </required>
+ </dependencies>
+ <phprelease/>
+ <changelog>
+ <release>
+ <version>
+ <release>1.3.0</release>
+ <api>1.3.0</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2005-11-06</date>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
+ <notes>
+* All request and response headers are now treated case-insensitively,
+ per RFC 2616 (bug #1045, bug #4367).
+* Values of multiple response headers with the same name are combined
+ into a comma-separated string per RFC 2616 (bug #1045)
+* Generate proper closing boundary for multipart/form-data requests,
+ per RFC 1521 (bug #4397)
+* magic_quotes_runtime directive is switched off when performing the
+ request since it may break file uploads and chunked responses (bug #4543)
+* Response::_readChunked() will finish on zero-length chunk rather than
+ socket eof (patch from bug #3037)
+* Added HTTP_Request::setBody() method, deprecated addRawPostData() due to
+ misleading name. The request body will be sent with all request methods
+ except those that explicitly forbid this (e.g. TRACE). Data set via
+ addPostData() / addFile() will only be sent with POST (see request #4716)
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>1.2.4</release>
+ <api>1.2.4</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2004-12-30</date>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
+ <notes>* Notice was raised when processing a response containing secure
+ cookies (bug #2741)
+* Warning was raised when processing a response with empty body and
+ chunked Transfer-encoding (bug #2792)
+* Improved inline documentation on constructor parameters (bug #2751)
+
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>1.2.3</release>
+ <api>1.2.3</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2004-10-01</date>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
+ <notes>* Auth information is properly extracted from URLs of the form http://user:pass@host/
+ (bug #1507)
+* Connection to server is closed after performing request (bug #1692)
+* Use correct argument separator for generated query stings (bug #1857, see
+ also bug #704 for Net_URL)
+* Do not use gzip encoding if certain string functions are overloaded by
+ mbstring extension (bug #1781)
+* addPostData() now properly handles multidimensional arrays (bug #2233)
+
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>1.2.2</release>
+ <api>1.2.2</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2004-05-19</date>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
+ <notes>Bug fixes:
+* Fixed #1037 (unable to connect to port 80 through HTTPS). This relies
+ on fix for Net_URL bug #1036, thus Net_URL 1.0.12 is now required.
+* Fixed #1333 (sending POST data on non-POST requests).
+* Fixed #1433 (overwriting the variable name when adding multiple files
+ for upload).
+
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>1.2.1</release>
+ <api>1.2.1</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2004-04-29</date>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
+ <notes>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 #842 (Doc comments incorrectly described the possible return values)
+ * Fixed #1152 (Incorrect handling of cookies with &apos;=&apos; in value)
+ * Fixed #1158 (Cookie parameters are not necessarily lowercase)
+ * Fixed #1080 (Cookies should not be urlencoded/urldecoded)
+
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>1.2</release>
+ <api>1.2</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2003-10-27</date>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
+ <notes>Feature additions:
+ * Support for multipart/form-data POST requests and file uploads (partly based on Christian Stocker&apos;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&apos;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>
+ <release>1.1.1</release>
+ <api>1.1.1</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2003-01-30</date>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
+ <notes>Added redirect support. Net_URL 1.0.7 is now required.
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>1.1.0</release>
+ <api>1.1.0</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2003-01-20</date>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
+ <notes>Added SSL support as long as you have PHP 4.3.0+ and the OpenSSL extension. Net_URL 1.0.6 is now required.
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>1.0.2</release>
+ <api>1.0.2</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2002-09-16</date>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
+ <notes>Added cookie support
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>1.0.1</release>
+ <api>1.0.1</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2002-07-27</date>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
+ <notes>License change
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>1.0</release>
+ <api>1.0</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2002-02-17</date>
+ <license uri="http://www.php.net/license">PHP License</license>
+ <notes>Initial release of the HTTP_Request package.
+ </notes>
+ </release>
+ </changelog>
+</package>
Please sign in to comment.
Something went wrong with that request. Please try again.