<h2 id="ob_etaghandler">string ob_etaghandler(string data, int mode)</h2>
<p>For use with ob_start(). Output buffer handler generating an ETag with<br />
the hash algorythm specified with the INI setting "http.etag_mode".</p>
-<h2 id="http_throttle">void http_throttle(double sec[, int bytes = 2097152])</h2>
+<h2 id="http_throttle">void http_throttle(double sec[, int bytes = 40960])</h2>
<p>Sets the throttle delay and send buffer size for use with http_send() API.<br />
Provides a basic throttling mechanism, which will yield the current process<br />
resp. thread until the entity has been completely sent, though.</p>
- compress: bool, whether to allow gzip/deflate content encoding<br />
(defaults to true)<br />
- port: int, use another port as specified in the url<br />
- - referer: string, the referer to sends<br />
+ - referer: string, the referer to send<br />
- useragent: string, the user agent to send<br />
(defaults to PECL::HTTP/version (PHP/version)))<br />
- headers: array, list of custom headers as associative array<br />
<p>Returns the request method name as string on success, or FALSE on failure.</p>
<h2 id="http_build_query">string http_build_query(mixed formdata [, string prefix[, string arg_separator]])</h2>
<p>Generates a form-encoded query string from an associative array or object.</p>
+<h2 id="http_gzencode">string http_gzencode(string data[, int level = -1])</h2>
+<p>Compress data with the HTTP compatible GZIP encoding.</p>
+<p>Expects the first parameter to be a string which contains the data that<br />
+should be encoded. Additionally accepts an optional in paramter specifying<br />
+the compression level, where -1 is default, 0 is no compression and 9 is<br />
+best compression ratio.</p>
+<p>Returns the encoded string on success, or NULL on failure.</p>
+<h2 id="http_gzdecode">string http_gzdecode(string data)</h2>
+<p>Uncompress data compressed with the HTTP compatible GZIP encoding.</p>
+<p>Expects a string as parameter containing the compressed data.</p>
+<p>Returns the decoded string on success, or NULL on failure.</p>
+<h2 id="http_deflate">string http_deflate(string data[, int level = -1])</h2>
+<p>Compress data with the HTTP compatible DEFLATE encoding.</p>
+<p>Expects the first parameter to be a string containing the data that should<br />
+be encoded. Additionally accepts an optional int parameter specifying the<br />
+compression level, where -1 is default, 0 is no compression and 9 is best<br />
+compression ratio.</p>
+<p>Returns the encoded string on success, or NULL on failure.</p>
+<h2 id="http_inflate">string http_inflate(string data)</h2>
+<p>Uncompress data compressed with the HTTP compatible DEFLATE encoding.</p>
+<p>Expects a string as parameter containing the compressed data.</p>
+<p>Returns the decoded string on success, or NULL on failure.</p>
+<h2 id="http_compress">string http_compress(string data[, int level = -1])</h2>
+<p>Compress data with the HTTP compatible COMPRESS encoding.</p>
+<p>Expects the first parameter to be a string containing the data which should<br />
+be encoded. Additionally accepts an optional int parameter specifying the<br />
+compression level, where -1 is default, 0 is no compression and 9 is best<br />
+compression ratio.</p>
+<p>Returns the encoded string on success, or NULL on failure.</p>
+<h2 id="http_uncompress">string http_uncompress(string data)</h2>
+<p>Uncompress data compressed with the HTTP compatible COMPRESS encoding.</p>
+<p>Expects a string as parameter containing the compressed data.</p>
+<p>Returns the decoded string on success, or NULL on failure.</p>
+<h2 id="http_support">int http_support([int feature = 0])</h2>
+<p>Check for feature that require external libraries.</p>
+<p>Accpepts an optional in parameter specifying which feature to probe for.<br />
+If the parameter is 0 or omitted, the return value contains a bitmask of <br />
+all supported features that depend on external libraries.</p>
+<p>Available features to probe for are:<br />
+<ul> <br />
+ <li> HTTP_SUPPORT: always set<br />
+ <li> HTTP_SUPPORT_REQUESTS: whether ext/http was linked against libcurl,<br />
+ and HTTP requests can be issued<br />
+ <li> HTTP_SUPPORT_SSLREQUESTS: whether libcurl was linked against openssl,<br />
+ and SSL requests can be issued <br />
+ <li> HTTP_SUPPORT_ENCODINGS: whether ext/http was linked against zlib,<br />
+ and compressed HTTP responses can be decoded<br />
+ <li> HTTP_SUPPORT_MHASHETAGS: whether ext/http was linked against libmhash,<br />
+ and ETags can be generated with the available mhash algorithms<br />
+ <li> HTTP_SUPPORT_MAGICMIME: whether ext/http was linked against libmagic,<br />
+ and the HttpResponse::guessContentType() method is usable<br />
+</ul></p>
+<p>Returns int, whether requested feature is supported, or a bitmask with<br />
+all supported features.</p>
<hr noshade>
<h1 id="http_message_object.c">http_message_object.c</h1>
<h2 id="HttpMessage" class="o">HttpMessage</h2>
<hr noshade>
<h1 id="http_request_object.c">http_request_object.c</h1>
<h2 id="HttpRequest" class="o">HttpRequest</h2>
-<h3 id="HttpRequest___construct">void HttpRequest::__construct([string url[, int request_method = HTTP_METH_GET]])</h3>
+<h3 id="HttpRequest___construct">void HttpRequest::__construct([string url[, int request_method = HTTP_METH_GET[, array options]]])</h3>
<p>Instantiate a new HttpRequest object.</p>
<p>Accepts a string as optional parameter containing the target request url.<br />
Additianally accepts an optional int parameter specifying the request method<br />
-to use.</p>
+to use and an associative array as optional third parameter which will be<br />
+passed to HttpRequest::setOptions(). </p>
<p>Throws HttpException.</p>
<h3 id="HttpRequest___destruct">void HttpRequest::__destruct()</h3>
<p>Destroys the HttpRequest object.</p>
<h3 id="HttpRequestPool_socketPerform">protected bool HttpRequestPool::socketPerform()</h3>
<p>Returns TRUE until each request has finished its transaction.</p>
<p>Usage:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB"><?php<br /> </span><span style="color: #007700">while (</span><span style="color: #0000BB">$pool</span><span style="color: #007700">-></span><span style="color: #0000BB">socketPerform</span><span style="color: #007700">()) {<br /> </span><span style="color: #0000BB">do_something_else</span><span style="color: #007700">();<br /> if (!</span><span style="color: #0000BB">$pool</span><span style="color: #007700">-></span><span style="color: #0000BB">socketSelect</span><span style="color: #007700">()) {<br /> die(</span><span style="color: #DD0000">'Socket error'</span><span style="color: #007700">);<br /> }<br /> }<br /></span><span style="color: #0000BB">?></span><br />
+<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">class </span><span style="color: #0000BB">MyPool </span><span style="color: #007700">extends </span><span style="color: #0000BB">HttpRequestPool<br /></span><span style="color: #007700">{<br /> public function </span><span style="color: #0000BB">send</span><span style="color: #007700">()<br /> {<br /> while (</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">socketPerform</span><span style="color: #007700">()) {<br /> if (!</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">socketSelect</span><span style="color: #007700">()) {<br /> throw new </span><span style="color: #0000BB">HttpSocketExcpetion</span><span style="color: #007700">;<br /> }<br /> }<br /> }<br /> <br /> protected final function </span><span style="color: #0000BB">socketPerform</span><span style="color: #007700">()<br /> {<br /> </span><span style="color: #0000BB">$result </span><span style="color: #007700">= </span><span style="color: #0000BB">parent</span><span style="color: #007700">::</span><span style="color: #0000BB">socketPerform</span><span style="color: #007700">();<br /> foreach (</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">getFinishedRequests</span><span style="color: #007700">() as </span><span style="color: #0000BB">$r</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">detach</span><span style="color: #007700">(</span><span style="color: #0000BB">$r</span><span style="color: #007700">);<br /> </span><span style="color: #FF8000">// handle response of finished request<br /> </span><span style="color: #007700">}<br /> return </span><span style="color: #0000BB">$result</span><span style="color: #007700">;<br /> }<br />} <br /></span><span style="color: #0000BB">?></span><br />
</span></code></blockquote></p>
<p></pre></p>
<h3 id="HttpRequestPool_socketSelect">protected bool HttpRequestPool::socketSelect()</h3>
<p>Implements Iterator::next().</p>
<h3 id="HttpRequestPool_rewind">void HttpRequestPool::rewind()</h3>
<p>Implements Iterator::rewind().</p>
+<h3 id="HttpRequestPool_getAttachedRequests">array HttpRequestPool::getAttachedRequests()</h3>
+<p>Get attached HttpRequest objects.</p>
+<p>Returns an array containing all currently attached HttpRequest objects.</p>
+<h3 id="HttpRequestPool_getFinishedRequests">array HttpRequestPool::getFinishedRequests()</h3>
+<p>Get attached HttpRequest objects that already have finished their work.</p>
+<p>Returns an array containing all attached HttpRequest objects that<br />
+already have finished their work.</p>
<hr noshade>
<h1 id="http_response_object.c">http_response_object.c</h1>
<h3 id="HttpResponse_setHeader">static bool HttpResponse::setHeader(string name, mixed value[, bool replace = true])</h3>
</li>
<li><a href="#http_build_query">http_build_query</a>
</li>
+<li><a href="#http_gzencode">http_gzencode</a>
+</li>
+<li><a href="#http_gzdecode">http_gzdecode</a>
+</li>
+<li><a href="#http_deflate">http_deflate</a>
+</li>
+<li><a href="#http_inflate">http_inflate</a>
+</li>
+<li><a href="#http_compress">http_compress</a>
+</li>
+<li><a href="#http_uncompress">http_uncompress</a>
+</li>
+<li><a href="#http_support">http_support</a>
+</li>
</ul>
</li>
<li><a href="#http_message_object.c">http_message_object.c
<li><a href="#HttpRequestPool_key">HttpRequestPool::key()</a></li>
<li><a href="#HttpRequestPool_next">HttpRequestPool::next()</a></li>
<li><a href="#HttpRequestPool_rewind">HttpRequestPool::rewind()</a></li>
+<li><a href="#HttpRequestPool_getAttachedRequests">HttpRequestPool::getAttachedRequests()</a></li>
+<li><a href="#HttpRequestPool_getFinishedRequests">HttpRequestPool::getFinishedRequests()</a></li>
</li>
</ul>
</li>
</li>
</ul>
</div>
- <p><b>Generated at: Wed, 05 Oct 2005 15:34:24 +0000</b></p>
+ <p><b>Generated at: Fri, 04 Nov 2005 12:29:06 +0100</b></p>
</body>
</html>