+<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[, 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 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="HttpRequest_setOptions">bool HttpRequest::setOptions([array options])</h3>
+<p>Set the request options to use. See http_get() for a full list of available options.</p>
+<p>Accepts an array as optional parameters, wich values will overwrite the <br />
+currently set request options. If the parameter is empty or mitted,<br />
+the optoions of the HttpRequest object will be reset.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_getOptions">array HttpRequest::getOptions()</h3>
+<p>Get currently set options.</p>
+<p>Returns an associative array containing currently set options.</p>
+<h3 id="HttpRequest_setSslOptions">bool HttpRequest::setSslOptions([array options])</h3>
+<p>Set SSL options.</p>
+<p>Accepts an associative array as parameter containing any SSL specific options.<br />
+If the parameter is empty or omitted, the SSL options will be reset.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_addSslOptions">bool HttpRequest::addSslOptions(array options)</h3>
+<p>Set additional SSL options.</p>
+<p>Expects an associative array as parameter containing additional SSL specific options.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_getSslOptions">array HttpRequest::getSslOtpions()</h3>
+<p>Get previously set SSL options.</p>
+<p>Returns an associative array containing any previously set SSL options.</p>
+<h3 id="HttpRequest_addHeaders">bool HttpRequest::addHeaders(array headers)</h3>
+<p>Add request header name/value pairs.</p>
+<p>Expects an ssociative array as parameter containing additional header<br />
+name/value pairs.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_setHeaders">bool HttpRequest::setHeaders([array headers])</h3>
+<p>Set request header name/value pairs.</p>
+<p>Accepts an associative array as parameter containing header name/value pairs.<br />
+If the parameter is empty or omitted, all previously set headers will be unset.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_getHeaders">array HttpRequest::getHeaders()</h3>
+<p>Get previously set request headers.</p>
+<p>Returns an associative array containing all currently set headers.</p>
+<h3 id="HttpRequest_setCookies">bool HttpRequest::setCookies([array cookies])</h3>
+<p>Set cookies.</p>
+<p>Accepts an associative array as parameter containing cookie name/value pairs.<br />
+If the parameter is empty or omitted, all previously set cookies will be unset.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_addCookies">bool HttpRequest::addCookies(array cookies)</h3>
+<p>Add cookies.</p>
+<p>Expects an associative array as parameter containing any cookie name/value<br />
+pairs to add.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_getCookies">array HttpRequest::getCookies()</h3>
+<p>Get previously set cookies.</p>
+<p>Returns an associative array containing any previously set cookies.</p>
+<h3 id="HttpRequest_setUrl">bool HttpRequest::setUrl(string url)</h3>
+<p>Set the request URL.</p>
+<p>Expects a string as parameter specifying the request url.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_getUrl">string HttpRequest::getUrl()</h3>
+<p>Get the previously set request URL.</p>
+<p>Returns the currently set request url as string.</p>
+<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>
+<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>Returns the currently set request method.</p>
+<h3 id="HttpRequest_setContentType">bool HttpRequest::setContentType(string content_type)</h3>
+<p>Set the content type the post request should have.</p>
+<p>Expects a string as parameters containing the content type of the request<br />
+(primary/secondary).</p>
+<p>Returns TRUE on success, or FALSE if the content type does not seem to<br />
+contain a primary and a secondary part.</p>
+<h3 id="HttpRequest_getContentType">string HttpRequest::getContentType()</h3>
+<p>Get the previously content type.</p>
+<p>Returns the previously set content type as string.</p>
+<h3 id="HttpRequest_setQueryData">bool HttpRequest::setQueryData([mixed query_data])</h3>
+<p>Set the URL query parameters to use, overwriting previously set query parameters.<br />
+Affects any request types.</p>
+<p>Accepts a string or associative array parameter containing the pre-encoded <br />
+query string or to be encoded query fields. If the parameter is empty or<br />
+omitted, the query data will be unset. </p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_getQueryData">string HttpRequest::getQueryData()</h3>
+<p>Get the current query data in form of an urlencoded query string.</p>
+<p>Returns a string containing the urlencoded query.</p>
+<h3 id="HttpRequest_addQueryData">bool HttpRequest::addQueryData(array query_params)</h3>
+<p>Add parameters to the query parameter list, leaving previously set unchanged.<br />
+Affects any request type.</p>
+<p>Expects an associative array as parameter containing the query fields to add.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_addPostFields">bool HttpRequest::addPostFields(array post_data)</h3>
+<p>Adds POST data entries, leaving previously set unchanged, unless a<br />
+post entry with the same name already exists. <br />
+Affects only POST and custom requests.</p>
+<p>Expects an associative array as parameter containing the post fields.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_setPostFields">bool HttpRequest::setPostFields([array post_data])</h3>
+<p>Set the POST data entries, overwriting previously set POST data.<br />
+Affects only POST and custom requests.</p>
+<p>Accepts an associative array as parameter containing the post fields.<br />
+If the parameter is empty or omitted, the post data will be unset.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_getPostFields">array HttpRequest::getPostFields()</h3>
+<p>Get previously set POST data.</p>
+<p>Returns the currently set post fields as associative array.</p>
+<h3 id="HttpRequest_setRawPostData">bool HttpRequest::setRawPostData([string raw_post_data])</h3>
+<p>Set raw post data to send, overwriting previously set raw post data. Don't <br />
+forget to specify a content type. Affects only POST and custom requests.<br />
+Only either post fields or raw post data can be used for each request.<br />
+Raw post data has higher precedence and will be used even if post fields<br />
+are set. </p>
+<p>Accepts a string as parameter containing the *raw* post data.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_addRawPostData">bool HttpRequest::addRawPostData(string raw_post_data)</h3>
+<p>Add raw post data, leaving previously set raw post data unchanged.<br />
+Affects only POST and custom requests.</p>
+<p>Expects a string as parameter containing the raw post data to concatenate.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_getRawPostData">string HttpRequest::getRawPostData()</h3>
+<p>Get previously set raw post data.</p>
+<p>Returns a string containing the currently set raw post data.</p>
+<h3 id="HttpRequest_addPostFile">bool HttpRequest::addPostFile(string name, string file[, string content_type = "application/x-octetstream"])</h3>
+<p>Add a file to the POST request, leaving prefiously set files unchanged.<br />
+Affects only POST and custom requests. Cannot be used with raw post data.</p>
+<p>Expects a string parameter containing the form element name, and a string<br />
+paremeter containing the path to the file which should be uploaded.<br />
+Additionally accepts an optional string parameter which chould contain<br />
+the content type of the file.</p>
+<p>Returns TRUE on success, or FALSE if the content type seems not to contain a <br />
+primary and a secondary content type part.</p>
+<h3 id="HttpRequest_setPostFiles">bool HttpRequest::setPostFiles([array post_files])</h3>
+<p>Set files to post, overwriting previously set post files.<br />
+Affects only POST and requests. Cannot be used with raw post data.</p>
+<p>Accepts an array containing the files to post. Each entry should be an<br />
+associative array with "name", "file" and "type" keys. If the parameter<br />
+is empty or omitted the post files will be unset.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_getPostFiles">array HttpRequest::getPostFiles()</h3>
+<p>Get all previously added POST files.</p>
+<p>Returns an array containing currently set post files.</p>
+<h3 id="HttpRequest_setPutFile">bool HttpRequest::setPutFile([string file])</h3>
+<p>Set file to put. Affects only PUT requests.</p>
+<p>Accepts a string as parameter referencing the path to file.<br />
+If the parameter is empty or omitted the put file will be unset.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_getPutFile">string HttpRequest::getPutFile()</h3>
+<p>Get previously set put file.</p>
+<p>Returns a string containing the path to the currently set put file.</p>
+<h3 id="HttpRequest_getResponseData">array HttpRequest::getResponseData()</h3>
+<p>Get all response data after the request has been sent.</p>
+<p>Returns an associative array with the key "headers" containing an associative<br />
+array holding all response headers, as well as the ley "body" containing a<br />
+string with the response body. </p>
+<p>If redirects were allowed and several responses were received, the data <br />
+references the last received response.</p>
+<h3 id="HttpRequest_getResponseHeader">mixed HttpRequest::getResponseHeader([string name])</h3>
+<p>Get response header(s) after the request has been sent.</p>
+<p>Accepts an string as optional parameter specifying a certain header to read.<br />
+If the parameter is empty or omitted all response headers will be returned.</p>
+<p>Returns either a string with the value of the header matching name if requested, <br />
+FALSE on failure, or an associative array containing all reponse headers.</p>
+<p>If redirects were allowed and several responses were received, the data <br />
+references the last received response.</p>
+<h3 id="HttpRequest_getResponseCookie">array HttpRequest::getResponseCookie([string name])</h3>
+<p>Get response cookie(s) after the request has been sent.</p>
+<p>Accepts a string as optional parameter specifying the name of the cookie to read.<br />
+If the parameter is empty or omitted, an associative array with all received<br />
+cookies will be returned.</p>
+<p>Returns either an associative array with the cookie's name, value and any<br />
+additional params of the cookie matching name if requested, FALSE on failure,<br />
+or an array containing all received cookies as arrays.</p>
+<p>If redirects were allowed and several responses were received, the data <br />
+references the last received response.</p>
+<h3 id="HttpRequest_getResponseBody">string HttpRequest::getResponseBody()</h3>
+<p>Get the response body after the request has been sent.</p>
+<p>Returns a string containing the response body.</p>
+<p>If redirects were allowed and several responses were received, the data <br />
+references the last received response.</p>
+<h3 id="HttpRequest_getResponseCode">int HttpRequest::getResponseCode()</h3>
+<p>Get the response code after the request has been sent.</p>
+<p>Returns an int representing the response code.</p>
+<p>If redirects were allowed and several responses were received, the data <br />
+references the last received response.</p>
+<h3 id="HttpRequest_getResponseInfo">mixed HttpRequest::getResponseInfo([string name])</h3>
+<p>Get response info after the request has been sent.<br />
+See http_get() for a full list of returned info.</p>
+<p>Accepts a string as optional parameter specifying the info to read.<br />
+If the parameter is empty or omitted, an associative array containing<br />
+all available info will be returned.</p>
+<p>Returns either a scalar containing the value of the info matching name if<br />
+requested, FALSE on failure, or an associative array containing all<br />
+available info.</p>
+<p>If redirects were allowed and several responses were received, the data <br />
+references the last received response.</p>
+<h3 id="HttpRequest_getResponseMessage">HttpMessage HttpRequest::getResponseMessage()</h3>
+<p>Get the full response as HttpMessage object after the request has been sent.</p>
+<p>Returns an HttpMessage object of the response.</p>
+<p>If redirects were allowed and several responses were received, the data <br />
+references the last received response. Use HttpMessage::getParentMessage()<br />
+to access the data of previously received responses whithin this request<br />
+cycle.</p>
+<p>Throws HttpException.</p>
+<h3 id="HttpRequest_getRequestMessage">HttpMessage HttpRequest::getRequestMessage()</h3>
+<p>Get sent HTTP message.</p>
+<p>Returns an HttpMessage object representing the sent request.</p>
+<p>If redirects were allowed and several responses were received, the data <br />
+references the last received response. Use HttpMessage::getParentMessage()<br />
+to access the data of previously sent requests whithin this request<br />
+cycle.</p>
+<p>Note that the internal request message is immutable, that means that the<br />
+request message received through HttpRequest::getRequestMessage() will<br />
+always look the same for the same request, regardless of any changes you<br />
+may have made to the returned object.</p>
+<p>Throws HttpMalformedHeadersException, HttpEncodingException.</p>
+<h3 id="HttpRequest_getHistory">HttpMessage HttpRequest::getHistory()</h3>
+<p>Get all sent requests and received responses as an HttpMessage object.</p>
+<p>If you don't want to record history at all, set the instance variable<br />
+HttpRequest::$recoedHistory to FALSE. </p>
+<p>Returns an HttpMessage object representing the complete request/response<br />
+history.</p>
+<p>The object references the last received response, use HttpMessage::getParentMessage() <br />
+to access the data of previously sent requests and received responses.</p>
+<p>Note that the internal history is immutable, that means that any changes<br />
+you make the the message list won't affect a history message list newly <br />
+created by another call to HttpRequest::getHistory().</p>
+<p>Throws HttpMalformedHeaderException, HttpEncodingException.</p>
+<h3 id="HttpRequest_clearHistory">void HttpRequest::clearHistory()</h3>
+<p>Clear the history.</p>
+<h3 id="HttpRequest_send">HttpMessage HttpRequest::send()</h3>
+<p>Send the HTTP request.</p>
+<p>Returns the received response as HttpMessage object.</p>
+<p>NOTE: While an exception may be thrown, the transfer could have succeeded <br />
+at least partially, so you might want to check the return values of various<br />
+HttpRequest::getResponse*() methods.</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">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">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>
+<h1 id="http_requestpool_object.c">http_requestpool_object.c</h1>
+<h2 id="HttpRequestPool" class="o">HttpRequestPool</h2>
+<h3 id="HttpRequestPool___construct">void HttpRequestPool::__construct([HttpRequest request[, ...]])</h3>
+<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>
+<p>Accepts virtual infinite optional parameters each referencing an<br />
+HttpRequest object.</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>
+<p></pre></p>
+<h3 id="HttpRequestPool___destruct">void HttpRequestPool::__destruct()</h3>
+<p>Clean up HttpRequestPool object.</p>
+<h3 id="HttpRequestPool_reset">void HttpRequestPool::reset()</h3>
+<p>Detach all attached HttpRequest objects.</p>
+<h3 id="HttpRequestPool_attach">bool HttpRequestPool::attach(HttpRequest request)</h3>
+<p>Attach an HttpRequest object to this HttpRequestPool.<br />
+WARNING: set all options prior attaching!</p>
+<p>Expects the parameter to be an HttpRequest object not alread attached to<br />
+antother HttpRequestPool object.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<p>Throws HttpInvalidParamException, HttpRequestException, <br />
+HttpRequestPoolException, HttpEncodingException.</p>
+<h3 id="HttpRequestPool_detach">bool HttpRequestPool::detach(HttpRequest request)</h3>
+<p>Detach an HttpRequest object from this HttpRequestPool.</p>
+<p>Expects the parameter to be an HttpRequest object attached to this<br />
+HttpRequestPool object.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<p>Throws HttpInvalidParamException, HttpRequestPoolException.</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 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 />
+<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>See HttpRequestPool::socketPerform().</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequestPool_valid">bool HttpRequestPool::valid()</h3>
+<p>Implements Iterator::valid().</p>
+<h3 id="HttpRequestPool_current">HttpRequest HttpRequestPool::current()</h3>
+<p>Implements Iterator::current().</p>
+<h3 id="HttpRequestPool_key">int HttpRequestPool::key()</h3>
+<p>Implements Iterator::key().</p>
+<h3 id="HttpRequestPool_next">void HttpRequestPool::next()</h3>
+<p>Implements Iterator::next().</p>
+<h3 id="HttpRequestPool_rewind">void HttpRequestPool::rewind()</h3>
+<p>Implements Iterator::rewind().</p>
+<h3 id="HttpRequestPool_count">int HttpRequestPool::count()</h3>
+<p>Implements Countable.</p>
+<p>Returns the number of attached HttpRequest objects.</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>
+<p>Send an HTTP header.</p>
+<p>Expects a string parameter containing the name of the header and a mixed<br />
+parameter containing the value of the header, which will be converted to<br />
+a string. Additionally accepts an optional boolean parameter, which<br />
+specifies whether an existing header should be replaced. If the second<br />
+parameter is unset no header with this name will be sent. </p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<p>Throws HttpHeaderException if http.only_exceptions is TRUE.</p>
+<h3 id="HttpResponse_getHeader">static mixed HttpResponse::getHeader([string name])</h3>
+<p>Get header(s) about to be sent.</p>
+<p>Accepts a string as optional parameter which specifies the name of the<br />
+header to read. If the parameter is empty or omitted, an associative array<br />
+with all headers will be returned.</p>
+<p>Returns either a string containing the value of the header matching name,<br />
+FALSE on failure, or an associative array with all headers.</p>
+<h3 id="HttpResponse_setCache">static bool HttpResponse::setCache(bool cache)</h3>
+<p>Whether it sould be attempted to cache the entitity.<br />
+This will result in necessary caching headers and checks of clients<br />
+"If-Modified-Since" and "If-None-Match" headers. If one of those headers<br />
+matches a "304 Not Modified" status code will be issued.</p>
+<p>NOTE: If you're using sessions, be shure that you set session.cache_limiter<br />
+to something more appropriate than "no-cache"!</p>
+<p>Expects a boolean as parameter specifying whether caching should be attempted.</p>
+<p>Returns TRUE ons success, or FALSE on failure.</p>
+<h3 id="HttpResponse_getCache">static bool HttpResponse::getCache()</h3>
+<p>Get current caching setting.</p>
+<p>Returns TRUE if caching should be attempted, else FALSE.</p>
+<h3 id="HttpResponse_setGzip">static bool HttpResponse::setGzip(bool gzip)</h3>
+<p>Enable on-thy-fly gzipping of the sent entity.</p>
+<p>Expects a boolean as parameter indicating if GZip compression should be enabled.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpResponse_getGzip">static bool HttpResponse::getGzip()</h3>
+<p>Get current gzipping setting.</p>
+<p>Returns TRUE if GZip compression is enabled, else FALSE.</p>
+<h3 id="HttpResponse_setCacheControl">static bool HttpResponse::setCacheControl(string control[, int max_age = 0])</h3>
+<p>Set a custom cache-control header, usually being "private" or "public";<br />
+The max_age parameter controls how long the cache entry is valid on the client side.</p>
+<p>Expects a string parameter containing the primary cache control setting.<br />
+Addtitionally accepts an int parameter specifying the max-age setting.</p>
+<p>Returns TRUE on success, or FALSE if control does not match one of<br />
+"public" , "private" or "no-cache".</p>
+<p>Throws HttpInvalidParamException if http.only_exceptions is TRUE.</p>
+<h3 id="HttpResponse_getCacheControl">static string HttpResponse::getCacheControl()</h3>
+<p>Get current Cache-Control header setting.</p>
+<p>Returns the current cache control setting as a string like sent in a header.</p>
+<h3 id="HttpResponse_setContentType">static bool HttpResponse::setContentType(string content_type)</h3>
+<p>Set the content-type of the sent entity.</p>
+<p>Expects a string as parameter specifying the content type of the sent entity.</p>
+<p>Returns TRUE on success, or FALSE if the content type does not seem to<br />
+contain a primary and secondary content type part.</p>
+<p>Throws HttpInvalidParamException if http.only_exceptions is TRUE.</p>
+<h3 id="HttpResponse_getContentType">static string HttpResponse::getContentType()</h3>
+<p>Get current Content-Type header setting.</p>
+<p>Returns the currently set content type as string.</p>
+<h3 id="HttpResponse_guessContentType">static string HttpResponse::guessContentType(string magic_file[, int magic_mode = MAGIC_MIME])</h3>
+<p>Attempts to guess the content type of supplied payload through libmagic.<br />
+If the attempt is successful, the guessed content type will automatically<br />
+be set as response content type. </p>
+<p>Expects a string parameter specifying the magic.mime database to use.<br />
+Additionally accepts an optional int parameter, being flags for libmagic.</p>
+<p>Returns the guessed content type on success, or FALSE on failure.</p>
+<p>Throws HttpRuntimeException, HttpInvalidParamException <br />
+if http.only_exceptions is TRUE.</p>
+<h3 id="HttpResponse_setContentDisposition">static bool HttpResponse::setContentDisposition(string filename[, bool inline = false])</h3>
+<p>Set the Content-Disposition. The Content-Disposition header is very useful<br />
+if the data actually sent came from a file or something similar, that should<br />
+be "saved" by the client/user (i.e. by browsers "Save as..." popup window).</p>
+<p>Expects a string parameter specifying the file name the "Save as..." dialogue<br />
+should display. Optionally accepts a bool parameter, which, if set to true<br />
+and the user agent knows how to handle the content type, will probably not<br />
+cause the popup window to be shown.</p>
+<p>Returns TRUE on success or FALSE on failure.</p>
+<h3 id="HttpResponse_getContentDisposition">static string HttpResponse::getContentDisposition()</h3>
+<p>Get current Content-Disposition setting.</p>
+<p>Returns the current content disposition as string like sent in a header.</p>
+<h3 id="HttpResponse_setETag">static bool HttpResponse::setETag(string etag)</h3>
+<p>Set a custom ETag. Use this only if you know what you're doing.</p>
+<p>Expects an unquoted string as parameter containing the ETag.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpResponse_getETag">static string HttpResponse::getETag()</h3>
+<p>Get calculated or previously set custom ETag.</p>
+<p>Returns the calculated or previously set ETag as unquoted string.</p>
+<h3 id="HttpResponse_setLastModified">static bool HttpResponse::setLastModified(int timestamp)</h3>
+<p>Set a custom Last-Modified date.</p>
+<p>Expects an unix timestamp as parameter representing the last modification<br />
+time of the sent entity.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpResponse_getLastModified">static int HttpResponse::getLastModified()</h3>
+<p>Get calculated or previously set custom Last-Modified date.</p>
+<p>Returns the calculated or previously set unix timestamp.</p>
+<h3 id="HttpResponse_setThrottleDelay">static bool HttpResponse::setThrottleDelay(double seconds)</h3>
+<p>Sets the throttle delay for use with HttpResponse::setBufferSize().</p>
+<p>Provides a basic throttling mechanism, which will yield the current process<br />
+resp. thread until the entity has been completely sent, though.</p>
+<p>Note: This doesn't really work with the FastCGI SAPI.</p>
+<p>Expects a double parameter specifying the seconds too sleep() after<br />
+each chunk sent.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpResponse_getThrottleDelay">static double HttpResponse::getThrottleDelay()</h3>
+<p>Get the current throttle delay.</p>
+<p>Returns a double representing the throttle delay in seconds.</p>
+<h3 id="HttpResponse_setBufferSize">static bool HttpResponse::setBufferSize(int bytes)</h3>
+<p>Sets the send buffer size for use with HttpResponse::setThrottleDelay().</p>
+<p>Provides a basic throttling mechanism, which will yield the current process<br />
+resp. thread until the entity has been completely sent, though.</p>
+<p>Note: This doesn't really work with the FastCGI SAPI.</p>
+<p>Expects an int parameter representing the chunk size in bytes.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpResponse_getBufferSize">static int HttpResponse::getBufferSize()</h3>
+<p>Get current buffer size.</p>
+<p>Returns an int representing the current buffer size in bytes.</p>
+<h3 id="HttpResponse_setData">static bool HttpResponse::setData(mixed data)</h3>
+<p>Set the data to be sent.</p>
+<p>Expects one parameter, which will be converted to a string and contains <br />
+the data to send.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpResponse_getData">static string HttpResponse::getData()</h3>
+<p>Get the previously set data to be sent.</p>
+<p>Returns a string containing the previously set data to send.</p>
+<h3 id="HttpResponse_setStream">static bool HttpResponse::setStream(resource stream)</h3>
+<p>Set the resource to be sent.</p>
+<p>Expects a resource parameter referencing an already opened stream from<br />
+which the data to send will be read.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpResponse_getStream">static resource HttpResponse::getStream()</h3>
+<p>Get the previously set resource to be sent.</p>
+<p>Returns the previously set resource.</p>
+<h3 id="HttpResponse_setFile">static bool HttpResponse::setFile(string file)</h3>
+<p>Set the file to be sent.</p>
+<p>Expects a string as parameter, specifying the path to the file to send.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpResponse_getFile">static string HttpResponse::getFile()</h3>
+<p>Get the previously set file to be sent.</p>
+<p>Returns the previously set path to the file to send as string.</p>
+<h3 id="HttpResponse_send">static bool HttpResponse::send([bool clean_ob = true])</h3>
+<p>Finally send the entity.</p>
+<p>Accepts an optional boolean parameter, specifying wheter the ouput<br />
+buffers should be discarded prior sending. A successful caching attempt<br />
+will cause a script termination, and write a log entry if the INI setting<br />
+http.cache_log is set.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<p>Throws HttpHeaderException, HttpResponseException if http.onyl_excpetions is TRUE.</p>
+<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
+<span style="color: #0000BB"><?php<br />HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">setCache</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">setContentType</span><span style="color: #007700">(</span><span style="color: #DD0000">'application/pdf'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">setContentDisposition</span><span style="color: #007700">(</span><span style="color: #DD0000">"$user.pdf"</span><span style="color: #007700">, </span><span style="color: #0000BB">false</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">setFile</span><span style="color: #007700">(</span><span style="color: #DD0000">'sheet.pdf'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">send</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?></span><br />
+</span></code></blockquote></p>
+<p></pre></p>
+<h3 id="HttpResponse_capture">static void HttpResponse::capture()</h3>
+<p>Capture script output.</p>
+<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
+<span style="color: #0000BB"><?php<br />HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">setCache</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">capture</span><span style="color: #007700">();<br /></span><span style="color: #FF8000">// script follows<br /></span><span style="color: #0000BB">?></span><br />
+</span></code></blockquote></p>
+<p></pre></p>