changelog & docs
[m6w6/ext-http] / docs / functions.html
index 880df1014cbd51aeeacb64069c845a85423e0f6e..dfe549637427b03b59ae5e035e214996eb883506 100644 (file)
 </head>
 <body><h1 id="http_functions.c">http_functions.c</h1>
 <h2 id="http_date">string http_date([int timestamp])</h2>
-<p>Compose a valid HTTP date regarding RFC 822/1123<br />
+<p>Compose a valid HTTP date regarding RFC 1123<br />
 looking like: "Wed, 22 Dec 2004 11:34:47 GMT"</p>
 <p>Accepts an optional unix timestamp as parameter.</p>
 <p>Returns the HTTP date as string.</p>
 <h2 id="http_build_url">string http_build_url(mixed url[, mixed parts[, int flags = HTTP_URL_REPLACE[, array &new_url]]])</h2>
-<p>Returns the new URL as string on success or FALSE on failure.</p>
+<p>Build an URL.</p>
+<p>Expexts (part(s) of) an URL as first parameter in form of a string or assoziative array<br />
+like parse_url() returns.  Accepts an optional second parameter in the same way as the<br />
+first argument.  Accepts an optional third integer parameter, which is a bitmask of<br />
+binary or'ed HTTP_URL_* constants.  The optional fourth parameter will be filled<br />
+with the results as associative array like parse_url() would return.</p>
+<p>The parts of the second URL will be merged into the first according to the flags argument.<br />
+The following flags are recognized:</p><pre>   - HTTP_URL_REPLACE:        (default) set parts of the second url will replace the parts in the first<br />
+       - HTTP_URL_JOIN_PATH:      the path of the second url will be merged into the one of the first<br />
+       - HTTP_URL_JOIN_QUERY:     the two querystrings will be merged naivly; no replacements are done<br />
+       - HTTP_URL_STRIP_USER:     the user part will not appear in the result<br />
+       - HTTP_URL_STRIP_PASS:     the password part will not appear in the result<br />
+       - HTTP_URL_STRIP_AUTH:     neither the user nor the password part will appear in the result<br />
+       - HTTP_URL_STRIP_PORT:     no explicit port will be set in the result<br />
+       - HTTP_URL_STRIP_PATH:     the path part will not appear in the result<br />
+       - HTTP_URL_STRIP_QUERY:    no query string will be present in the result<br />
+       - HTTP_URL_STRIP_FRAGMENT: no fragment will be present in the result<br />
+</pre></p>
+<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
+<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;ftp://ftp.example.com/pub/files/current/?a=b&amp;a=c<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">http_build_url</span><span style="color: #007700">(</span><span style="color: #DD0000">"http://user@www.example.com/pub/index.php?a=b#files"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"scheme"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"ftp"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"host"&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"ftp.example.com"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"path"&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"files/current/"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"query"&nbsp;&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"a=c"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">HTTP_URL_STRIP_AUTH&nbsp;</span><span style="color: #007700">|&nbsp;</span><span style="color: #0000BB">HTTP_URL_JOIN_PATH&nbsp;</span><span style="color: #007700">|&nbsp;</span><span style="color: #0000BB">HTTP_URL_JOIN_QUERY&nbsp;</span><span style="color: #007700">|&nbsp;</span><span style="color: #0000BB">HTTP_URL_STRIP_FRAGMENT<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span><br />
+</span></code></blockquote></p>
+<p></pre><br />
+Returns the new URL as string on success or FALSE on failure.</p>
 <h2 id="http_build_str">string http_build_str(array query [, string prefix[, string arg_separator]])</h2>
 <p>Opponent to parse_str().</p>
+<p>Expects an array as first argument which represents the parts of the query string to build.<br />
+Accepts a string as optional second parameter containing a top-level prefix to use.<br />
+The optional third parameter should specify an argument separator to use (by default the<br />
+INI setting arg_separator.output will be used, or "&" if neither is set).</p>
+<p>Returns the built query as string on success or FALSE on failure.</p>
 <h2 id="http_negotiate_language">string http_negotiate_language(array supported[, array &result])</h2>
 <p>This function negotiates the clients preferred language based on its<br />
 Accept-Language HTTP header.  The qualifier is recognized and languages <br />
@@ -296,6 +323,8 @@ array where the following keys will be recognized:</p><pre> - redirect:
                      like array("header" => "value")<br />
  - cookies:          array, list of cookies as associative array<br />
                      like array("cookie" => "value")<br />
+ - encodecookies:    bool, whether to urlencode the cookies (default: true)<br />
+ - resetcookies:     bool, wheter to reset the cookies<br />
  - cookiestore:      string, path to a file where cookies are/will be stored<br />
  - resume:           int, byte offset to start the download from;<br />
                      if the server supports ranges<br />
@@ -552,6 +581,9 @@ should also contain any parent messages.</p>
 <h3 id="HttpMessage_prepend">void HttpMessage::prepend(HttpMessage message)</h3>
 <p>Prepends message(s) to the HTTP message.</p>
 <p>Expects an HttpMessage object as parameter.</p>
+<h3 id="HttpMessage_reverse">HttpMessage HttpMessage::reverse()</h3>
+<p>Reorders the message chain in reverse order.</p>
+<p>Returns the most parent HttpMessage object.</p>
 <h3 id="HttpMessage_rewind">void HttpMessage::rewind(void)</h3>
 <p>Implements Iterator.</p>
 <h3 id="HttpMessage_valid">bool HttpMessage::valid(void)</h3>
@@ -1201,6 +1233,7 @@ http.cache_log is set.</p>
 <li><a href="#HttpMessage_unserialize">HttpMessage::unserialize()</a></li>
 <li><a href="#HttpMessage_detach">HttpMessage::detach()</a></li>
 <li><a href="#HttpMessage_prepend">HttpMessage::prepend()</a></li>
+<li><a href="#HttpMessage_reverse">HttpMessage::reverse()</a></li>
 <li><a href="#HttpMessage_rewind">HttpMessage::rewind()</a></li>
 <li><a href="#HttpMessage_valid">HttpMessage::valid()</a></li>
 <li><a href="#HttpMessage_next">HttpMessage::next()</a></li>
@@ -1328,7 +1361,7 @@ http.cache_log is set.</p>
 </li>
 </ul>
 </div>
-    <p><b>Generated at: Mon, 06 Feb 2006 13:45:38 +0100</b></p>
+    <p><b>Generated at: Sat, 11 Feb 2006 15:09:37 +0100</b></p>
 </body>
 </html>