the SERVER_NAME or just localhost if prior are not available.<br />
If a port is pecified in either the url or as sperate parameter,<br />
it will be added if it differs from te default port for HTTP(S).</p>
-<p>Returns the absolute URI as string.</p>
+<p>Returns the absolute URI as string on success or false on failure.</p>
<p>Examples:</p><pre><blockquote><code><span style="color: #000000"><br />
<span style="color: #0000BB"><?php<br />$uri </span><span style="color: #007700">= </span><span style="color: #0000BB">http_build_uri</span><span style="color: #007700">(</span><span style="color: #DD0000">"page.php"</span><span style="color: #007700">, </span><span style="color: #DD0000">"https"</span><span style="color: #007700">, </span><span style="color: #0000BB">NULL</span><span style="color: #007700">, </span><span style="color: #0000BB">488</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span><br />
</span></code></blockquote></p>
<p>Expects a string parameter containing HTTP headers.</p>
<p>Returns an array on success, or FALSE on failure.</p>
<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB"><?php<br />$headers </span><span style="color: #007700">= </span><span style="color: #DD0000">"content-type: text/html; charset=UTF-8\r\n"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"Server: Funky/1.0\r\n"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"Set-Cookie: foo=bar\r\n"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"Set-Cookie: baz=quux\r\n"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"Folded: works\r\n\ttoo\r\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">http_parse_headers</span><span style="color: #007700">(</span><span style="color: #0000BB">$headers</span><span style="color: #007700">));<br /><br />Array<br />(<br /> [</span><span style="color: #0000BB">Content</span><span style="color: #007700">-</span><span style="color: #0000BB">Type</span><span style="color: #007700">] => </span><span style="color: #0000BB">text</span><span style="color: #007700">/</span><span style="color: #0000BB">html</span><span style="color: #007700">; </span><span style="color: #0000BB">chatset</span><span style="color: #007700">=</span><span style="color: #0000BB">UTF</span><span style="color: #007700">-</span><span style="color: #0000BB">8<br /> </span><span style="color: #007700">[</span><span style="color: #0000BB">Server</span><span style="color: #007700">] => </span><span style="color: #0000BB">Funky</span><span style="color: #007700">/</span><span style="color: #0000BB">1.0<br /> </span><span style="color: #007700">[</span><span style="color: #0000BB">Set</span><span style="color: #007700">-</span><span style="color: #0000BB">Cookie</span><span style="color: #007700">] => Array<br /> (<br /> [</span><span style="color: #0000BB">0</span><span style="color: #007700">] => </span><span style="color: #0000BB">foo</span><span style="color: #007700">=</span><span style="color: #0000BB">bar<br /> </span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">] => </span><span style="color: #0000BB">baz</span><span style="color: #007700">=</span><span style="color: #0000BB">quux<br /> </span><span style="color: #007700">)<br /> [</span><span style="color: #0000BB">Folded</span><span style="color: #007700">] => </span><span style="color: #0000BB">works<br /> too <br />?></span><br />
+<span style="color: #0000BB"><?php<br />$headers </span><span style="color: #007700">= </span><span style="color: #DD0000">"content-type: text/html; charset=UTF-8\r\n"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"Server: Funky/1.0\r\n"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"Set-Cookie: foo=bar\r\n"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"Set-Cookie: baz=quux\r\n"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"Folded: works\r\n\ttoo\r\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">http_parse_headers</span><span style="color: #007700">(</span><span style="color: #0000BB">$headers</span><span style="color: #007700">));<br /><br />Array<br />(<br /> [</span><span style="color: #0000BB">Content</span><span style="color: #007700">-</span><span style="color: #0000BB">Type</span><span style="color: #007700">] => </span><span style="color: #0000BB">text</span><span style="color: #007700">/</span><span style="color: #0000BB">html</span><span style="color: #007700">; </span><span style="color: #0000BB">chatset</span><span style="color: #007700">=</span><span style="color: #0000BB">UTF</span><span style="color: #007700">-</span><span style="color: #0000BB">8<br /> </span><span style="color: #007700">[</span><span style="color: #0000BB">Server</span><span style="color: #007700">] => </span><span style="color: #0000BB">Funky</span><span style="color: #007700">/</span><span style="color: #0000BB">1.0<br /> </span><span style="color: #007700">[</span><span style="color: #0000BB">Set</span><span style="color: #007700">-</span><span style="color: #0000BB">Cookie</span><span style="color: #007700">] => Array<br /> (<br /> [</span><span style="color: #0000BB">0</span><span style="color: #007700">] => </span><span style="color: #0000BB">foo</span><span style="color: #007700">=</span><span style="color: #0000BB">bar<br /> </span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">] => </span><span style="color: #0000BB">baz</span><span style="color: #007700">=</span><span style="color: #0000BB">quux<br /> </span><span style="color: #007700">)<br /> [</span><span style="color: #0000BB">Folded</span><span style="color: #007700">] => </span><span style="color: #0000BB">works<br /> too <br /></span><span style="color: #007700">) <br /></span><span style="color: #0000BB">?></span><br />
+</span></code></blockquote></p>
+<p></pre></p>
+<h2 id="http_parse_cookie">object http_parse_cookie(string cookie)</h2>
+<p>Parses HTTP cookies like sent in a response into a struct.</p>
+<p>Expects a string as parameter containing the value of a Set-Cookie response header.</p>
+<p>Returns an stdClass object with the cookie params as properties on success or FALSE on failure.</p>
+<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
+<span style="color: #0000BB"><?php<br />print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">http_parse_cookie</span><span style="color: #007700">(</span><span style="color: #DD0000">"foo=bar; path=/"</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">stdClass Object<br /></span><span style="color: #007700">(<br /> [</span><span style="color: #0000BB">name</span><span style="color: #007700">] => </span><span style="color: #0000BB">foo<br /> </span><span style="color: #007700">[</span><span style="color: #0000BB">value</span><span style="color: #007700">] => </span><span style="color: #0000BB">bar<br /> </span><span style="color: #007700">[</span><span style="color: #0000BB">path</span><span style="color: #007700">] => /<br />)<br /></span><span style="color: #0000BB">?></span><br />
</span></code></blockquote></p>
<p></pre></p>
<h2 id="http_get_request_headers">array http_get_request_headers(void)</h2>
<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>
+<h2 id="http_gzencode">string http_gzencode(string data[, int level = -1[, int mtime = 0]])</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 />
<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>
+<h2 id="http_deflate">string http_deflate(string data[, int level = -1[, bool zlib_header = false]])</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 />
<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 />
<h3 id="HttpRequest_setMethod">bool HttpRequest::setMethod(int request_method)</h3>
<p>Set the request method.</p>
<p>Expects an int as parameter specifying the request method to use.<br />
-In PHP 5.1+ HttpRequest::METH, otherwise the HTTP_METH constants can be used.</p>
+In PHP 5.1+ HttpRequest::METH_*, otherwise the HTTP_METH_* constants can be used.</p>
<p>Returns TRUE on success, or FALSE on failure.</p>
<h3 id="HttpRequest_getMethod">int HttpRequest::getMethod()</h3>
<p>Get the previously set request method.</p>
<p>Throws HttpRuntimeException, HttpRequestException, <br />
HttpMalformedHeaderException, HttpEncodingException.</p>
<p>GET example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB"><?php<br />$r </span><span style="color: #007700">= new </span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">(</span><span style="color: #DD0000">'http://example.com/feed.rss'</span><span style="color: #007700">, </span><span style="color: #0000BB">HTTP_GET</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">setOptions</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'lastmodified' </span><span style="color: #007700">=> </span><span style="color: #0000BB">filemtime</span><span style="color: #007700">(</span><span style="color: #DD0000">'local.rss'</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">addQueryData</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'category' </span><span style="color: #007700">=> </span><span style="color: #0000BB">3</span><span style="color: #007700">));<br />try {<br /> </span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">send</span><span style="color: #007700">();<br /> if (</span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">getResponseCode</span><span style="color: #007700">() == </span><span style="color: #0000BB">200</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">file_put_contents</span><span style="color: #007700">(</span><span style="color: #DD0000">'local.rss'</span><span style="color: #007700">, </span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">getResponseBody</span><span style="color: #007700">());<br /> }<br />} catch (</span><span style="color: #0000BB">HttpException $ex</span><span style="color: #007700">) {<br /> echo </span><span style="color: #0000BB">$ex</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?></span><br />
+<span style="color: #0000BB"><?php<br />$r </span><span style="color: #007700">= new </span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">(</span><span style="color: #DD0000">'http://example.com/feed.rss'</span><span style="color: #007700">, </span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">::</span><span style="color: #0000BB">METH_GET</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">setOptions</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'lastmodified' </span><span style="color: #007700">=> </span><span style="color: #0000BB">filemtime</span><span style="color: #007700">(</span><span style="color: #DD0000">'local.rss'</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">addQueryData</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'category' </span><span style="color: #007700">=> </span><span style="color: #0000BB">3</span><span style="color: #007700">));<br />try {<br /> </span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">send</span><span style="color: #007700">();<br /> if (</span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">getResponseCode</span><span style="color: #007700">() == </span><span style="color: #0000BB">200</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">file_put_contents</span><span style="color: #007700">(</span><span style="color: #DD0000">'local.rss'</span><span style="color: #007700">, </span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">getResponseBody</span><span style="color: #007700">());<br /> }<br />} catch (</span><span style="color: #0000BB">HttpException $ex</span><span style="color: #007700">) {<br /> echo </span><span style="color: #0000BB">$ex</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?></span><br />
</span></code></blockquote></p>
<p></pre></p>
<p>POST example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB"><?php<br />$r </span><span style="color: #007700">= new </span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">(</span><span style="color: #DD0000">'http://example.com/form.php'</span><span style="color: #007700">, </span><span style="color: #0000BB">HTTP_POST</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">setOptions</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'cookies' </span><span style="color: #007700">=> array(</span><span style="color: #DD0000">'lang' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'de'</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">addPostFields</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'user' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'mike'</span><span style="color: #007700">, </span><span style="color: #DD0000">'pass' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'s3c|r3t'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">addPostFile</span><span style="color: #007700">(</span><span style="color: #DD0000">'image'</span><span style="color: #007700">, </span><span style="color: #DD0000">'profile.jpg'</span><span style="color: #007700">, </span><span style="color: #DD0000">'image/jpeg'</span><span style="color: #007700">);<br />try {<br /> echo </span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">send</span><span style="color: #007700">()-></span><span style="color: #0000BB">getBody</span><span style="color: #007700">();<br />} catch (</span><span style="color: #0000BB">HttpException $ex</span><span style="color: #007700">) {<br /> echo </span><span style="color: #0000BB">$ex</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?></span><br />
+<span style="color: #0000BB"><?php<br />$r </span><span style="color: #007700">= new </span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">(</span><span style="color: #DD0000">'http://example.com/form.php'</span><span style="color: #007700">, </span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">::</span><span style="color: #0000BB">METH_POST</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">setOptions</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'cookies' </span><span style="color: #007700">=> array(</span><span style="color: #DD0000">'lang' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'de'</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">addPostFields</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'user' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'mike'</span><span style="color: #007700">, </span><span style="color: #DD0000">'pass' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'s3c|r3t'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">addPostFile</span><span style="color: #007700">(</span><span style="color: #DD0000">'image'</span><span style="color: #007700">, </span><span style="color: #DD0000">'profile.jpg'</span><span style="color: #007700">, </span><span style="color: #DD0000">'image/jpeg'</span><span style="color: #007700">);<br />try {<br /> echo </span><span style="color: #0000BB">$r</span><span style="color: #007700">-></span><span style="color: #0000BB">send</span><span style="color: #007700">()-></span><span style="color: #0000BB">getBody</span><span style="color: #007700">();<br />} catch (</span><span style="color: #0000BB">HttpException $ex</span><span style="color: #007700">) {<br /> echo </span><span style="color: #0000BB">$ex</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?></span><br />
</span></code></blockquote></p>
<p></pre></p>
<hr noshade>
<p>Instantiate a new HttpRequestPool object. An HttpRequestPool is<br />
able to send several HttpRequests in parallel.</p>
<p>WARNING: Don't attach/detach HttpRequest objects to the HttpRequestPool<br />
-object while you're using the implemented Interator interface. </p>
+object while you're using the implemented Iterator interface. </p>
<p>Accepts virtual infinite optional parameters each referencing an<br />
HttpRequest object.</p>
-<p>Throws HttpRequestException, HttpRequestPoolException, HttpInvalidParamException.</p>
+<p>Throws HttpRequestPoolException (HttpRequestException, HttpInvalidParamException).</p>
<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">try {<br /> </span><span style="color: #0000BB">$pool </span><span style="color: #007700">= new </span><span style="color: #0000BB">HttpRequestPool</span><span style="color: #007700">(<br /> new </span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">(</span><span style="color: #DD0000">'http://www.google.com/'</span><span style="color: #007700">, </span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">::</span><span style="color: #0000BB">METH_HEAD</span><span style="color: #007700">),<br /> new </span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">(</span><span style="color: #DD0000">'http://www.php.net/'</span><span style="color: #007700">, </span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">::</span><span style="color: #0000BB">METH_HEAD</span><span style="color: #007700">)<br /> );<br /> </span><span style="color: #0000BB">$pool</span><span style="color: #007700">-></span><span style="color: #0000BB">send</span><span style="color: #007700">();<br /> foreach(</span><span style="color: #0000BB">$pool </span><span style="color: #007700">as </span><span style="color: #0000BB">$request</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"%s is %s (%d)\n"</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">$request</span><span style="color: #007700">-></span><span style="color: #0000BB">getUrl</span><span style="color: #007700">(),<br /> </span><span style="color: #0000BB">$request</span><span style="color: #007700">-></span><span style="color: #0000BB">getResponseCode</span><span style="color: #007700">() ? </span><span style="color: #DD0000">'alive' </span><span style="color: #007700">: </span><span style="color: #DD0000">'not alive'</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">$request</span><span style="color: #007700">-></span><span style="color: #0000BB">getResponseCode</span><span style="color: #007700">()<br /> );<br /> }<br />} catch (</span><span style="color: #0000BB">HttpException $e</span><span style="color: #007700">) {<br /> echo </span><span style="color: #0000BB">$e</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?></span><br />
</span></code></blockquote></p>
<h3 id="HttpRequestPool_send">bool HttpRequestPool::send()</h3>
<p>Send all attached HttpRequest objects in parallel.</p>
<p>Returns TRUE on success, or FALSE on failure.</p>
-<p>Throws HttpSocketException, HttpRequestException, <br />
-HttpRequestPoolException, HttpMalformedHeaderException.</p>
+<p>Throws HttpRequestPoolException (HttpSocketException, HttpRequestException, HttpMalformedHeaderException).</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 />
</li>
<li><a href="#http_parse_headers">http_parse_headers</a>
</li>
+<li><a href="#http_parse_cookie">http_parse_cookie</a>
+</li>
<li><a href="#http_get_request_headers">http_get_request_headers</a>
</li>
<li><a href="#http_get_request_body">http_get_request_body</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>
</ul>
</div>
- <p><b>Generated at: Mon, 21 Nov 2005 16:56:18 +0100</b></p>
+ <p><b>Generated at: Wed, 14 Dec 2005 16:25:48 +0100</b></p>
</body>
</html>