<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>
+<h2 id="http_parse_cookie">object http_parse_cookie(string cookie[, int flags[, array allowed_extras]])</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>Returns an stdClass olike shown in the example 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 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; bar=baz; path=/; domain=example.com; comment=; secure"</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, array(</span><span style="color: #DD0000">"comment"</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">cookies</span><span style="color: #007700">] => Array<br /> (<br /> [</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">bar</span><span style="color: #007700">] => </span><span style="color: #0000BB">baz<br /> </span><span style="color: #007700">)<br /><br /> [</span><span style="color: #0000BB">extras</span><span style="color: #007700">] => Array<br /> (<br /> [</span><span style="color: #0000BB">comment</span><span style="color: #007700">] =><br /> )<br /><br /> [</span><span style="color: #0000BB">flags</span><span style="color: #007700">] => </span><span style="color: #0000BB">16<br /> </span><span style="color: #007700">[</span><span style="color: #0000BB">expires</span><span style="color: #007700">] => </span><span style="color: #0000BB">0<br /> </span><span style="color: #007700">[</span><span style="color: #0000BB">path</span><span style="color: #007700">] => /<br /> [</span><span style="color: #0000BB">domain</span><span style="color: #007700">] => </span><span style="color: #0000BB">example</span><span style="color: #007700">.</span><span style="color: #0000BB">com<br /></span><span style="color: #007700">)<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>
</pre></p>
<p>The optional third parameter will be filled with some additional information<br />
in form of an associative array, if supplied, like the following example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">array (<br /> </span><span style="color: #DD0000">'effective_url' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'http://localhost'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'response_code' </span><span style="color: #007700">=> </span><span style="color: #0000BB">403</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'total_time' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0.017</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'namelookup_time' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0.013</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'connect_time' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0.014</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'pretransfer_time' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0.014</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'size_upload' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'size_download' </span><span style="color: #007700">=> </span><span style="color: #0000BB">202</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'speed_download' </span><span style="color: #007700">=> </span><span style="color: #0000BB">11882</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'speed_upload' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'header_size' </span><span style="color: #007700">=> </span><span style="color: #0000BB">145</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'request_size' </span><span style="color: #007700">=> </span><span style="color: #0000BB">62</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'ssl_verifyresult' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'filetime' </span><span style="color: #007700">=> -</span><span style="color: #0000BB">1</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'content_length_download' </span><span style="color: #007700">=> </span><span style="color: #0000BB">202</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'content_length_upload' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'starttransfer_time' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0.017</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'content_type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'text/html; charset=iso-8859-1'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'redirect_time' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'redirect_count' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'http_connectcode' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'httpauth_avail' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'proxyauth_avail' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br />)<br /></span><span style="color: #0000BB">?></span><br />
+<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">array (<br /> </span><span style="color: #DD0000">'effective_url' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'http://www.example.com/'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'response_code' </span><span style="color: #007700">=> </span><span style="color: #0000BB">302</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'connect_code' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'filetime' </span><span style="color: #007700">=> -</span><span style="color: #0000BB">1</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'total_time' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0.212348</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'namelookup_time' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0.038296</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'connect_time' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0.104144</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'pretransfer_time' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0.104307</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'starttransfer_time' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0.212077</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'redirect_time' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'redirect_count' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'size_upload' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'size_download' </span><span style="color: #007700">=> </span><span style="color: #0000BB">218</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'speed_download' </span><span style="color: #007700">=> </span><span style="color: #0000BB">1026</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'speed_upload' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'header_size' </span><span style="color: #007700">=> </span><span style="color: #0000BB">307</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'request_size' </span><span style="color: #007700">=> </span><span style="color: #0000BB">103</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'ssl_verifyresult' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'ssl_engines' </span><span style="color: #007700">=><br /> array (<br /> </span><span style="color: #0000BB">0 </span><span style="color: #007700">=> </span><span style="color: #DD0000">'dynamic'</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">1 </span><span style="color: #007700">=> </span><span style="color: #DD0000">'cswift'</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">2 </span><span style="color: #007700">=> </span><span style="color: #DD0000">'chil'</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">3 </span><span style="color: #007700">=> </span><span style="color: #DD0000">'atalla'</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">4 </span><span style="color: #007700">=> </span><span style="color: #DD0000">'nuron'</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">5 </span><span style="color: #007700">=> </span><span style="color: #DD0000">'ubsec'</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">6 </span><span style="color: #007700">=> </span><span style="color: #DD0000">'aep'</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">7 </span><span style="color: #007700">=> </span><span style="color: #DD0000">'sureware'</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">8 </span><span style="color: #007700">=> </span><span style="color: #DD0000">'4758cca'</span><span style="color: #007700">,<br /> ),<br /> </span><span style="color: #DD0000">'content_length_download' </span><span style="color: #007700">=> </span><span style="color: #0000BB">218</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'content_length_upload' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'content_type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'text/html'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'httpauth_avail' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'proxyauth_avail' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'num_connects' </span><span style="color: #007700">=> </span><span style="color: #0000BB">1</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'os_errno' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'error' </span><span style="color: #007700">=> </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br /> )<br /></span><span style="color: #0000BB">?></span><br />
</span></code></blockquote></p>
<p></pre></p>
<p>Returns the HTTP response(s) as string on success, or FALSE on failure.</p>
FALSE on failure, or an associative array containing all response 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>
+<h3 id="HttpRequest_getResponseCookies">array HttpRequest::getResponseCookies([int flags[, array allowed_extras]])</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>Returns an array of stdClass objects like http_parse_cookie would return.</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>Returns the complete web server response, including the headers in a form of a string.</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::$recordHistory to FALSE. </p>
+<p>If you want to record history, set the instance variable<br />
+HttpRequest::$recordHistory to TRUE.</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>
+<p>Throws HttpRuntimeException.</p>
<h3 id="HttpRequest_clearHistory">void HttpRequest::clearHistory()</h3>
<p>Clear the history.</p>
<h3 id="HttpRequest_send">HttpMessage HttpRequest::send()</h3>
<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>
+<h3 id="HttpResponse_setCacheControl">static bool HttpResponse::setCacheControl(string control[, int max_age = 0[, bool must_revalidate = true]])</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 />
-Additionally accepts an int parameter specifying the max-age setting.</p>
+Additionally accepts an int parameter specifying the max-age setting.<br />
+Accepts an optional third bool parameter indicating whether the cache<br />
+must be revalidated every request.</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>
<li><a href="#HttpRequest_getPutFile">HttpRequest::getPutFile()</a></li>
<li><a href="#HttpRequest_getResponseData">HttpRequest::getResponseData()</a></li>
<li><a href="#HttpRequest_getResponseHeader">HttpRequest::getResponseHeader()</a></li>
-<li><a href="#HttpRequest_getResponseCookie">HttpRequest::getResponseCookie()</a></li>
+<li><a href="#HttpRequest_getResponseCookies">HttpRequest::getResponseCookies()</a></li>
<li><a href="#HttpRequest_getResponseBody">HttpRequest::getResponseBody()</a></li>
<li><a href="#HttpRequest_getResponseCode">HttpRequest::getResponseCode()</a></li>
<li><a href="#HttpRequest_getResponseStatus">HttpRequest::getResponseStatus()</a></li>
</li>
</ul>
</div>
- <p><b>Generated at: Sat, 11 Feb 2006 15:09:37 +0100</b></p>
+ <p><b>Generated at: Wed, 15 Feb 2006 08:40:01 +0100</b></p>
</body>
</html>