X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=docs%2Ffunctions.html;h=dfe549637427b03b59ae5e035e214996eb883506;hb=6fe020cffcca62537ae61d4637d56c76b3364f71;hp=880df1014cbd51aeeacb64069c845a85423e0f6e;hpb=1f5a1441ed2a2a655f1bdcbf962c59b6e6c311a8;p=m6w6%2Fext-http diff --git a/docs/functions.html b/docs/functions.html index 880df10..dfe5496 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -70,14 +70,41 @@

http_functions.c

string http_date([int timestamp])

-

Compose a valid HTTP date regarding RFC 822/1123
+

Compose a valid HTTP date regarding RFC 1123
looking like: "Wed, 22 Dec 2004 11:34:47 GMT"

Accepts an optional unix timestamp as parameter.

Returns the HTTP date as string.

string http_build_url(mixed url[, mixed parts[, int flags = HTTP_URL_REPLACE[, array &new_url]]])

-

Returns the new URL as string on success or FALSE on failure.

+

Build an URL.

+

Expexts (part(s) of) an URL as first parameter in form of a string or assoziative array
+like parse_url() returns. Accepts an optional second parameter in the same way as the
+first argument. Accepts an optional third integer parameter, which is a bitmask of
+binary or'ed HTTP_URL_* constants. The optional fourth parameter will be filled
+with the results as associative array like parse_url() would return.

+

The parts of the second URL will be merged into the first according to the flags argument.
+The following flags are recognized:

	- HTTP_URL_REPLACE:        (default) set parts of the second url will replace the parts in the first
+ - HTTP_URL_JOIN_PATH: the path of the second url will be merged into the one of the first
+ - HTTP_URL_JOIN_QUERY: the two querystrings will be merged naivly; no replacements are done
+ - HTTP_URL_STRIP_USER: the user part will not appear in the result
+ - HTTP_URL_STRIP_PASS: the password part will not appear in the result
+ - HTTP_URL_STRIP_AUTH: neither the user nor the password part will appear in the result
+ - HTTP_URL_STRIP_PORT: no explicit port will be set in the result
+ - HTTP_URL_STRIP_PATH: the path part will not appear in the result
+ - HTTP_URL_STRIP_QUERY: no query string will be present in the result
+ - HTTP_URL_STRIP_FRAGMENT: no fragment will be present in the result
+

+

Example:


+<?php
        
// ftp://ftp.example.com/pub/files/current/?a=b&a=c
        
echo http_build_url("http://user@www.example.com/pub/index.php?a=b#files",
            array(
                
"scheme" => "ftp",
                
"host"   => "ftp.example.com",
                
"path"   => "files/current/",
                
"query"  => "a=c"
            
),
            
HTTP_URL_STRIP_AUTH HTTP_URL_JOIN_PATH HTTP_URL_JOIN_QUERY HTTP_URL_STRIP_FRAGMENT
        
);
?>
+

+


+Returns the new URL as string on success or FALSE on failure.

string http_build_str(array query [, string prefix[, string arg_separator]])

Opponent to parse_str().

+

Expects an array as first argument which represents the parts of the query string to build.
+Accepts a string as optional second parameter containing a top-level prefix to use.
+The optional third parameter should specify an argument separator to use (by default the
+INI setting arg_separator.output will be used, or "&" if neither is set).

+

Returns the built query as string on success or FALSE on failure.

string http_negotiate_language(array supported[, array &result])

This function negotiates the clients preferred language based on its
Accept-Language HTTP header. The qualifier is recognized and languages
@@ -296,6 +323,8 @@ array where the following keys will be recognized:

 - redirect:
                      like array("header" => "value")
- cookies: array, list of cookies as associative array
like array("cookie" => "value")
+ - encodecookies: bool, whether to urlencode the cookies (default: true)
+ - resetcookies: bool, wheter to reset the cookies
- cookiestore: string, path to a file where cookies are/will be stored
- resume: int, byte offset to start the download from;
if the server supports ranges
@@ -552,6 +581,9 @@ should also contain any parent messages.

void HttpMessage::prepend(HttpMessage message)

Prepends message(s) to the HTTP message.

Expects an HttpMessage object as parameter.

+

HttpMessage HttpMessage::reverse()

+

Reorders the message chain in reverse order.

+

Returns the most parent HttpMessage object.

void HttpMessage::rewind(void)

Implements Iterator.

bool HttpMessage::valid(void)

@@ -1201,6 +1233,7 @@ http.cache_log is set.

  • HttpMessage::unserialize()
  • HttpMessage::detach()
  • HttpMessage::prepend()
  • +
  • HttpMessage::reverse()
  • HttpMessage::rewind()
  • HttpMessage::valid()
  • HttpMessage::next()
  • @@ -1328,7 +1361,7 @@ http.cache_log is set.

    -

    Generated at: Mon, 06 Feb 2006 13:45:38 +0100

    +

    Generated at: Sat, 11 Feb 2006 15:09:37 +0100