From 81c3521be871065967dca651a6ceac3cf0463d59 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 24 Jul 2006 11:35:01 +0000 Subject: [PATCH] - duh, somehow that didn't get through the last time git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@216967 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../functions/caching/http-cache-etag.xml | 155 ++++++++ .../caching/http-cache-last-modified.xml | 156 ++++++++ .../encodings/http-chunked-decode.xml | 142 +++++++ .../http/functions/encodings/http-deflate.xml | 154 +++++++ .../http/functions/encodings/http-inflate.xml | 143 +++++++ reference/http/functions/header.xml | 273 ------------- reference/http/functions/headers-list.xml | 90 ----- reference/http/functions/headers-sent.xml | 97 ----- .../http/functions/misc/http-build-cookie.xml | 144 +++++++ reference/http/functions/misc/http-date.xml | 143 +++++++ .../misc/http-get-request-body-stream.xml | 135 +++++++ .../functions/misc/http-get-request-body.xml | 137 +++++++ .../misc/http-get-request-headers.xml | 132 ++++++ .../http/functions/misc/http-match-etag.xml | 152 +++++++ .../functions/misc/http-match-modified.xml | 160 ++++++++ .../misc/http-match-request-header.xml | 160 ++++++++ .../http/functions/misc/http-support.xml | 147 +++++++ .../negotiation/http-negotiate-charset.xml | 153 +++++++ .../negotiation/http-negotiate-ctype.xml | 139 +++++++ .../negotiation/http-negotiate-language.xml | 151 +++++++ .../outputhandlers/ob-deflatehandler.xml | 130 ++++++ .../outputhandlers/ob-etaghandler.xml | 129 ++++++ .../outputhandlers/ob-inflatehandler.xml | 125 ++++++ .../functions/parsers/http-parse-cookie.xml | 169 ++++++++ .../functions/parsers/http-parse-headers.xml | 149 +++++++ .../functions/parsers/http-parse-message.xml | 158 ++++++++ .../functions/parsers/http-parse-params.xml | 155 ++++++++ .../http/functions/requests/http-get.xml | 375 ++++++++++++++++++ .../http/functions/requests/http-head.xml | 161 ++++++++ .../functions/requests/http-post-data.xml | 170 ++++++++ .../functions/requests/http-post-fields.xml | 179 +++++++++ .../http/functions/requests/http-put-data.xml | 170 ++++++++ .../http/functions/requests/http-put-file.xml | 170 ++++++++ .../functions/requests/http-put-stream.xml | 170 ++++++++ .../requests/http-request-body-encode.xml | 153 +++++++ .../requests/http-request-method-exists.xml | 142 +++++++ .../requests/http-request-method-name.xml | 142 +++++++ .../requests/http-request-method-register.xml | 142 +++++++ .../http-request-method-unregister.xml | 144 +++++++ .../http/functions/requests/http-request.xml | 180 +++++++++ .../functions/responses/http-redirect.xml | 206 ++++++++++ .../http-send-content-disposition.xml | 156 ++++++++ .../responses/http-send-content-type.xml | 145 +++++++ .../functions/responses/http-send-data.xml | 144 +++++++ .../functions/responses/http-send-file.xml | 144 +++++++ .../responses/http-send-last-modified.xml | 145 +++++++ .../functions/responses/http-send-status.xml | 144 +++++++ .../functions/responses/http-send-stream.xml | 144 +++++++ .../functions/responses/http-throttle.xml | 142 +++++++ reference/http/functions/setcookie.xml | 371 ----------------- reference/http/functions/setrawcookie.xml | 51 --- .../http/functions/urls/http-build-str.xml | 162 ++++++++ .../http/functions/urls/http-build-url.xml | 174 ++++++++ 53 files changed, 7522 insertions(+), 882 deletions(-) create mode 100644 reference/http/functions/caching/http-cache-etag.xml create mode 100644 reference/http/functions/caching/http-cache-last-modified.xml create mode 100644 reference/http/functions/encodings/http-chunked-decode.xml create mode 100644 reference/http/functions/encodings/http-deflate.xml create mode 100644 reference/http/functions/encodings/http-inflate.xml delete mode 100644 reference/http/functions/header.xml delete mode 100644 reference/http/functions/headers-list.xml delete mode 100644 reference/http/functions/headers-sent.xml create mode 100644 reference/http/functions/misc/http-build-cookie.xml create mode 100644 reference/http/functions/misc/http-date.xml create mode 100644 reference/http/functions/misc/http-get-request-body-stream.xml create mode 100644 reference/http/functions/misc/http-get-request-body.xml create mode 100644 reference/http/functions/misc/http-get-request-headers.xml create mode 100644 reference/http/functions/misc/http-match-etag.xml create mode 100644 reference/http/functions/misc/http-match-modified.xml create mode 100644 reference/http/functions/misc/http-match-request-header.xml create mode 100644 reference/http/functions/misc/http-support.xml create mode 100644 reference/http/functions/negotiation/http-negotiate-charset.xml create mode 100644 reference/http/functions/negotiation/http-negotiate-ctype.xml create mode 100644 reference/http/functions/negotiation/http-negotiate-language.xml create mode 100644 reference/http/functions/outputhandlers/ob-deflatehandler.xml create mode 100644 reference/http/functions/outputhandlers/ob-etaghandler.xml create mode 100644 reference/http/functions/outputhandlers/ob-inflatehandler.xml create mode 100644 reference/http/functions/parsers/http-parse-cookie.xml create mode 100644 reference/http/functions/parsers/http-parse-headers.xml create mode 100644 reference/http/functions/parsers/http-parse-message.xml create mode 100644 reference/http/functions/parsers/http-parse-params.xml create mode 100644 reference/http/functions/requests/http-get.xml create mode 100644 reference/http/functions/requests/http-head.xml create mode 100644 reference/http/functions/requests/http-post-data.xml create mode 100644 reference/http/functions/requests/http-post-fields.xml create mode 100644 reference/http/functions/requests/http-put-data.xml create mode 100644 reference/http/functions/requests/http-put-file.xml create mode 100644 reference/http/functions/requests/http-put-stream.xml create mode 100644 reference/http/functions/requests/http-request-body-encode.xml create mode 100644 reference/http/functions/requests/http-request-method-exists.xml create mode 100644 reference/http/functions/requests/http-request-method-name.xml create mode 100644 reference/http/functions/requests/http-request-method-register.xml create mode 100644 reference/http/functions/requests/http-request-method-unregister.xml create mode 100644 reference/http/functions/requests/http-request.xml create mode 100644 reference/http/functions/responses/http-redirect.xml create mode 100644 reference/http/functions/responses/http-send-content-disposition.xml create mode 100644 reference/http/functions/responses/http-send-content-type.xml create mode 100644 reference/http/functions/responses/http-send-data.xml create mode 100644 reference/http/functions/responses/http-send-file.xml create mode 100644 reference/http/functions/responses/http-send-last-modified.xml create mode 100644 reference/http/functions/responses/http-send-status.xml create mode 100644 reference/http/functions/responses/http-send-stream.xml create mode 100644 reference/http/functions/responses/http-throttle.xml delete mode 100644 reference/http/functions/setcookie.xml delete mode 100644 reference/http/functions/setrawcookie.xml create mode 100644 reference/http/functions/urls/http-build-str.xml create mode 100644 reference/http/functions/urls/http-build-url.xml diff --git a/reference/http/functions/caching/http-cache-etag.xml b/reference/http/functions/caching/http-cache-etag.xml new file mode 100644 index 0000000000..59e05f18f9 --- /dev/null +++ b/reference/http/functions/caching/http-cache-etag.xml @@ -0,0 +1,155 @@ + + + + + + http_cache_etag + Caching by ETag + + + &reftitle.description; + + boolhttp_cache_etag + stringetag + + + + Attempts to cache the sent entity by its ETag, either supplied or generated + by the hash algorithm specified by the + INI setting http.etag.mode. + + + If the clients If-None-Match header matches the supplied/calculated + ETag, the body is considered cached on the clients side and + a 304 Not Modified status code is issued. + + + A log entry is written to the cache log if the + INI entry http.log.cache + is set and the cache attempt was successful. + + + + &reftitle.parameters; + + + + etag + + + Custom ETag + + + + + + + + &reftitle.returnvalues; + + Returns FALSE on failure, or exits with 304 Not Modified if the entity is cached. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/caching/http-cache-last-modified.xml b/reference/http/functions/caching/http-cache-last-modified.xml new file mode 100644 index 0000000000..68b7e9862a --- /dev/null +++ b/reference/http/functions/caching/http-cache-last-modified.xml @@ -0,0 +1,156 @@ + + + + + + http_cache_last_modified + Caching by last modification + + + &reftitle.description; + + boolhttp_cache_last_modified + inttimestamp_or_expires + + + + Attempts to cache the sent entity by its last modification date. + + + If the supplied argument is greater than 0, it is handled as timestamp + and will be sent as date of last modification. If it is 0 or omitted, + the current time will be sent as Last-Modified date. If it's negative, + it is handled as expiration time in seconds, which means that if the + requested last modification date is not between the calculated timespan, + the Last-Modified header is updated and the actual body will be sent. + + + A log entry will be written to the cache log if the + &link.http.configuration; http.log.cache + is set and the cache attempt was successful. + + + + &reftitle.parameters; + + + + timestamp_or_expires + + + Unix timestamp + + + + + + + + &reftitle.returnvalues; + + Returns FALSE on failure, or exits with 304 Not Modified if the entity is cached. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/encodings/http-chunked-decode.xml b/reference/http/functions/encodings/http-chunked-decode.xml new file mode 100644 index 0000000000..f014a17bb4 --- /dev/null +++ b/reference/http/functions/encodings/http-chunked-decode.xml @@ -0,0 +1,142 @@ + + + + + + http_chunked_decode + Decode chunked-encoded data + + + &reftitle.description; + + stringhttp_chunked_decode + stringencoded + + + Decodes a string which is HTTP-chunked encoded. + + + + &reftitle.parameters; + + + + encoded + + + Chunked encoded string + + + + + + + + &reftitle.returnvalues; + + Returns the decoded string on success or FALSE on failure. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/encodings/http-deflate.xml b/reference/http/functions/encodings/http-deflate.xml new file mode 100644 index 0000000000..c01c2c6c80 --- /dev/null +++ b/reference/http/functions/encodings/http-deflate.xml @@ -0,0 +1,154 @@ + + + + + + http_deflate + Deflate data + + + &reftitle.description; + + stringhttp_deflate + stringdata + intflags = 0 + + + Compress data with gzip, zlib AKA deflate or raw deflate encoding. + + + See the deflate constants table for possible values for the flags parameter. + + + + &reftitle.parameters; + + + + data + + + String containing the data that should be encoded + + + + + flags + + + Deflate options + + + + + + + + &reftitle.returnvalues; + + Returns the encoded string on success, or NULL on failure. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/encodings/http-inflate.xml b/reference/http/functions/encodings/http-inflate.xml new file mode 100644 index 0000000000..e18cdb6b5a --- /dev/null +++ b/reference/http/functions/encodings/http-inflate.xml @@ -0,0 +1,143 @@ + + + + + + http_inflate + Inflate data + + + &reftitle.description; + + stringhttp_inflate + stringdata + + + Decompress data compressed with either gzip, deflate AKA zlib or raw + deflate encoding. + + + + &reftitle.parameters; + + + + data + + + String containing the compressed data + + + + + + + + &reftitle.returnvalues; + + Returns the decoded string on success, or NULL on failure. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/header.xml b/reference/http/functions/header.xml deleted file mode 100644 index 3d5b9ee06c..0000000000 --- a/reference/http/functions/header.xml +++ /dev/null @@ -1,273 +0,0 @@ - - - - - - header - Send a raw HTTP header - - - Description - - voidheader - stringstring - boolreplace - inthttp_response_code - - - header is used to send a raw - HTTP header. See the HTTP/1.1 specification for more - information on HTTP headers. - - - - Since PHP 4.4.2 and PHP 5.1.2 this function prevents more than one - header to be sent at once as a protection against header injection - attacks. - - - - The optional replace parameter indicates - whether the header should replace a previous similar header, or - add a second header of the same type. By default it will replace, - but if you pass in &false; as the second argument you can force - multiple headers of the same type. For example: - - - - - -]]> - - - - - The second optional http_response_code force the - HTTP response code to the specified value. (This parameter is available - in PHP 4.3.0 and higher.) - - - There are two special-case header calls. The first is a header - that starts with the string "HTTP/" (case is not - significant), which will be used to figure out the HTTP status - code to send. For example, if you have configured Apache to - use a PHP script to handle requests for missing files (using - the ErrorDocument directive), you may want to - make sure that your script generates the proper status code. - - - - - -]]> - - - - - - The HTTP status header line will always be the first sent - to the client, regardless of the actual header - call being the first or not. The status may be overridden - by calling header with a new status line - at any time unless the HTTP headers have already been sent. - - - - The second special case is the "Location:" header. Not only does - it send this header back to the browser, but it also returns a - REDIRECT (302) status code to the browser unless - some 3xx status code has already been set. - - - - - -]]> - - - - - - HTTP/1.1 requires an absolute URI as argument to - Location: - including the scheme, hostname and absolute path, but - some clients accept relative URIs. You can usually use - $_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF'] - and dirname to make an absolute URI from a - relative one yourself: - - - -]]> - - - - - - - Session ID is not passed with Location header even if session.use_trans_sid is - enabled. It must by passed manually using SID - constant. - - - - PHP scripts often generate dynamic content that must not be cached - by the client browser or any proxy caches between the server and the - client browser. Many proxies and clients can be forced to disable - caching with: - - - - - -]]> - - - - - - You may find that your pages aren't cached even if you don't - output all of the headers above. There are a number of options - that users may be able to set for their browser that change its - default caching behavior. By sending the headers above, you should - override any settings that may otherwise cause the output of your - script to be cached. - - - Additionally, session_cache_limiter and - the session.cache_limiter configuration - setting can be used to automatically generate the correct - caching-related headers when sessions are being used. - - - - Remember that header must be - called before any actual output is sent, either by normal HTML - tags, blank lines in a file, or from PHP. It is a very common - error to read code with include, or - require, functions, or another file access - function, and have spaces or empty lines that are output before - header is called. The same problem exists - when using a single PHP/HTML file. - - - - - - -]]> - - - - - - As of PHP 4, you can use output buffering to get around this problem, - with the overhead of all of your output to the browser being buffered - in the server until you send it. You can do this by calling - ob_start and ob_end_flush - in your script, or setting the output_buffering - configuration directive on in your &php.ini; or - server configuration files. - - - - If you want the user to be prompted to save the data you are - sending, such as a generated PDF file, you can use the Content-Disposition header to - supply a recommended filename and force the browser to display the - save dialog. - - - - - -]]> - - - - - - There is a bug in Microsoft Internet Explorer 4.01 that prevents - this from working. There is no workaround. There is also a bug - in Microsoft Internet Explorer 5.5 that interferes with this, - which can be resolved by upgrading to Service Pack 2 or later. - - - - - If safe mode is enabled the - uid of the script is added to the realm part - of the WWW-Authenticate header if you set - this header (used for HTTP Authentication). - - - - See also headers_sent, - setcookie, and the section on - HTTP authentication. - - - - - diff --git a/reference/http/functions/headers-list.xml b/reference/http/functions/headers-list.xml deleted file mode 100644 index 06e166ab37..0000000000 --- a/reference/http/functions/headers-list.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - headers_list - Returns a list of response headers sent (or ready to send) - - - Description - - arrayheaders_list - - - - headers_list will return a numerically indexed array - of headers to be sent to the browser / client. To determine whether or not - these headers have been sent yet, use headers_sent. - - - - Examples using <function>headers_list</function> - - -]]> - - - this will output : - - - - string(23) "X-Powered-By: PHP/5.1.3" - [1]=> - string(19) "Set-Cookie: foo=bar" - [2]=> - string(18) "X-Sample-Test: foo" - [3]=> - string(24) "Content-type: text/plain" -} - -]]> - - - - - See Also: - headers_sent, - header, and - setcookie. - - - - - diff --git a/reference/http/functions/headers-sent.xml b/reference/http/functions/headers-sent.xml deleted file mode 100644 index ff8d3ae199..0000000000 --- a/reference/http/functions/headers-sent.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - headers_sent - Checks if or where headers have been sent - - - Description - - boolheaders_sent - stringfile - intline - - - headers_sent will return &false; if no HTTP headers - have already been sent or &true; otherwise. If the optional - file and line parameters - are set, headers_sent will put the PHP source - file name and line number where output started in the file - and line variables. - - - You can't add any more header lines using the header - function once the header block has already been sent. Using this function - you can at least prevent getting HTTP header related error messages. - Another option is to use Output Buffering. - - - - The optional file and line - parameters were added in PHP 4.3.0. - - - - - Examples using <function>headers_sent</function> - -link instead\n"; - exit; -} - -?> -]]> - - - - - See also ob_start, trigger_error, - and header for a more detailed discussion of the - matters involved. - - - - - diff --git a/reference/http/functions/misc/http-build-cookie.xml b/reference/http/functions/misc/http-build-cookie.xml new file mode 100644 index 0000000000..d25271a1c1 --- /dev/null +++ b/reference/http/functions/misc/http-build-cookie.xml @@ -0,0 +1,144 @@ + + + + + + http_build_cookie + Build cookie string + + + &reftitle.description; + + stringhttp_build_cookie + arraycookie + + + + Build a cookie string from an array/object like returned by http_parse_cookie. + + + + + &reftitle.parameters; + + + + cookie + + + a cookie list like returned from http_parse_cookie + + + + + + + + &reftitle.returnvalues; + + Returns the cookie(s) as string. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/misc/http-date.xml b/reference/http/functions/misc/http-date.xml new file mode 100644 index 0000000000..19abe50f78 --- /dev/null +++ b/reference/http/functions/misc/http-date.xml @@ -0,0 +1,143 @@ + + + + + + http_date + Compose HTTP RFC compliant date + + + &reftitle.description; + + stringhttp_date + inttimestamp + + + Compose a valid HTTP date regarding RFC 1123 + looking like: Wed, 22 Dec 2004 11:34:47 GMT. + + + + &reftitle.parameters; + + + + timestamp + + + Unix timestamp + + + + + + + + &reftitle.returnvalues; + + Returns the HTTP date as string. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/misc/http-get-request-body-stream.xml b/reference/http/functions/misc/http-get-request-body-stream.xml new file mode 100644 index 0000000000..1bf122614e --- /dev/null +++ b/reference/http/functions/misc/http-get-request-body-stream.xml @@ -0,0 +1,135 @@ + + + + + + http_get_request_body_stream + Get request body as stream + + + &reftitle.description; + + resourcehttp_get_request_body_stream + + + + Create a stream to read the raw request body (e.g. POST or PUT data). + + + This function can only be used once if the request method was another than POST. + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + Returns the raw request body as stream on success or NULL on failure. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/misc/http-get-request-body.xml b/reference/http/functions/misc/http-get-request-body.xml new file mode 100644 index 0000000000..94a83fd6ea --- /dev/null +++ b/reference/http/functions/misc/http-get-request-body.xml @@ -0,0 +1,137 @@ + + + + + + http_get_request_body + Get request body as string + + + &reftitle.description; + + stringhttp_get_request_body + + + + Get the raw request body (e.g. POST or PUT data). + + + This function can not be used after + http_get_request_body_stream + if the request method was another than POST. + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + Returns the raw request body as string on success or NULL on failure. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/misc/http-get-request-headers.xml b/reference/http/functions/misc/http-get-request-headers.xml new file mode 100644 index 0000000000..640e49e237 --- /dev/null +++ b/reference/http/functions/misc/http-get-request-headers.xml @@ -0,0 +1,132 @@ + + + + + + http_get_request_headers + Get request headers as array + + + &reftitle.description; + + arrayhttp_get_request_headers + + + + Get a list of incoming HTTP headers. + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + Returns an associative array of incoming request headers. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/misc/http-match-etag.xml b/reference/http/functions/misc/http-match-etag.xml new file mode 100644 index 0000000000..0234d3d1ff --- /dev/null +++ b/reference/http/functions/misc/http-match-etag.xml @@ -0,0 +1,152 @@ + + + + + + http_match_etag + Match ETag + + + &reftitle.description; + + boolhttp_match_etag + stringetag + boolfor_range = FALSE + + + Matches the given ETag against the clients If-Match resp. + If-None-Match HTTP headers. + + + + &reftitle.parameters; + + + + etag + + + The ETag to match + + + + + for_range + + + If set to TRUE, the header usually used to validate HTTP ranges will be checked + + + + + + + + &reftitle.returnvalues; + + Returns TRUE if ETag matches or the header contained the asterisk ("*"), else FALSE. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/misc/http-match-modified.xml b/reference/http/functions/misc/http-match-modified.xml new file mode 100644 index 0000000000..fc93f4197d --- /dev/null +++ b/reference/http/functions/misc/http-match-modified.xml @@ -0,0 +1,160 @@ + + + + + + http_match_modified + Match last modification + + + &reftitle.description; + + boolhttp_match_modified + inttimestamp + boolfor_range = FALSE + + + Matches the given unix timestamp against the clients "If-Modified-Since" + resp. "If-Unmodified-Since" HTTP headers. + + + + &reftitle.parameters; + + + + timestamp + + + Unix timestamp; current time, if omitted + + + + + for_range + + + If set to TRUE, the header usually used to validate HTTP ranges will be checked + + + + + false + + + Its description + + + + + + + + &reftitle.returnvalues; + + Returns TRUE if timestamp represents an earlier date than the header, else FALSE. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/misc/http-match-request-header.xml b/reference/http/functions/misc/http-match-request-header.xml new file mode 100644 index 0000000000..e851c838ce --- /dev/null +++ b/reference/http/functions/misc/http-match-request-header.xml @@ -0,0 +1,160 @@ + + + + + + http_match_request_header + Match any header + + + &reftitle.description; + + boolhttp_match_request_header + stringheader + stringvalue + boolmatch_case = FALSE + + + Match an incoming HTTP header. + + + + &reftitle.parameters; + + + + header + + + The header name (case-insensitive) + + + + + value + + + The header value that should be compared + + + + + match_case + + + Whether the value should be compared case sensitively + + + + + + + + &reftitle.returnvalues; + + Returns TRUE if header value matches, else FALSE. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/misc/http-support.xml b/reference/http/functions/misc/http-support.xml new file mode 100644 index 0000000000..2bc92a7641 --- /dev/null +++ b/reference/http/functions/misc/http-support.xml @@ -0,0 +1,147 @@ + + + + + + http_support + Check builtin HTTP support + + + &reftitle.description; + + inthttp_support + intfeature = 0 + + + Check for features that require external libraries. + + + See the feature support constants table + for possible values for the feature argument. + + + + &reftitle.parameters; + + + + feature + + + Feature to probe for; if the parameter is 0 or omitted, the return value contains a bitmask of + all supported features that depend on external libraries + + + + + + + + &reftitle.returnvalues; + + Returns int, whether requested feature is supported, or a bitmask with all supported features. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/negotiation/http-negotiate-charset.xml b/reference/http/functions/negotiation/http-negotiate-charset.xml new file mode 100644 index 0000000000..045345a3a2 --- /dev/null +++ b/reference/http/functions/negotiation/http-negotiate-charset.xml @@ -0,0 +1,153 @@ + + + + + + http_negotiate_charset + Negotiate clients preferred character set + + + &reftitle.description; + + stringhttp_negotiate_charset + arraysupported + arrayresult + + + This function negotiates the clients preferred charset based on its + Accept-Charset HTTP header. The qualifier is recognized and charsets + without qualifier are rated highest. + + + + &reftitle.parameters; + + + + supported + + + Array containing the supported charsets as values + + + + + result + + + Will be filled with an array containing the negotiation results + + + + + + + + &reftitle.returnvalues; + + Returns the negotiated charset or the default charset (i.e. first array entry) if none match. + + + + + + + + + + + &reftitle.examples; + + + Using <function>http_negotiate_charset</function> + + +]]> + + + + + + + + + + + + diff --git a/reference/http/functions/negotiation/http-negotiate-ctype.xml b/reference/http/functions/negotiation/http-negotiate-ctype.xml new file mode 100644 index 0000000000..da46e748c9 --- /dev/null +++ b/reference/http/functions/negotiation/http-negotiate-ctype.xml @@ -0,0 +1,139 @@ + + + + + + http_negotiate_ctype + Negotiate clients preferred content type + + + &reftitle.description; + + stringhttp_negotiate_ctype + arraysupported + arrayresult + + + This function negotiates the clients preferred content type based on its + Accept HTTP header. The qualifier is recognized and content types + without qualifier are rated highest. + + + + &reftitle.parameters; + + + + supported + + + Array containing the supported content types as values + + + + + result + + + Will be filled with an array containing the negotiation results + + + + + + + + &reftitle.returnvalues; + + Returns the negotiated content type or the default content type (i.e. first array entry) if none match. + + + + + + + + + + + &reftitle.examples; + + + Using <function>http_negotiate_ctype</function> + + +]]> + + + + + + + + + + + + diff --git a/reference/http/functions/negotiation/http-negotiate-language.xml b/reference/http/functions/negotiation/http-negotiate-language.xml new file mode 100644 index 0000000000..29e28ba230 --- /dev/null +++ b/reference/http/functions/negotiation/http-negotiate-language.xml @@ -0,0 +1,151 @@ + + + + + + http_negotiate_language + Negotiate clients preferred language + + + &reftitle.description; + + stringhttp_negotiate_language + arraysupported + arrayresult + + + This function negotiates the clients preferred language based on its + Accept-Language HTTP header. The qualifier is recognized and languages + without qualifier are rated highest. The qualifier will be decreased by + 10% for partial matches (i.e. matching primary language). + + + + &reftitle.parameters; + + + + supported + + + Array containing the supported languages as values + + + + + result + + + Will be filled with an array containing the negotiation results + + + + + + + + &reftitle.returnvalues; + + Returns the negotiated language or the default language (i.e. first array entry) if none match. + + + + + + + + + + + &reftitle.examples; + + + Using <function>http_negotiate_language</function> + + +]]> + + + + + + + + + + + + diff --git a/reference/http/functions/outputhandlers/ob-deflatehandler.xml b/reference/http/functions/outputhandlers/ob-deflatehandler.xml new file mode 100644 index 0000000000..758c5945b1 --- /dev/null +++ b/reference/http/functions/outputhandlers/ob-deflatehandler.xml @@ -0,0 +1,130 @@ + + + + + + ob_deflatehandler + Deflate output handler + + + &reftitle.description; + + stringob_deflatehandler + stringdata + intmode + + + For use with ob_start. + + + The deflate output buffer handler can only be used once. + + + It conflicts with ob_gzhandler and zlib.output_compression as well and should + not be used after ext/mbstrings mb_output_handler and ext/sessions URL-Rewriter (AKA + session.use_trans_sid). + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/outputhandlers/ob-etaghandler.xml b/reference/http/functions/outputhandlers/ob-etaghandler.xml new file mode 100644 index 0000000000..d97496465b --- /dev/null +++ b/reference/http/functions/outputhandlers/ob-etaghandler.xml @@ -0,0 +1,129 @@ + + + + + + ob_etaghandler + ETag output handler + + + &reftitle.description; + + stringob_etaghandler + stringdata + intmode + + + For use with ob_start. + + + Output buffer handler generating an ETag with the hash algorithm specified with the + &link.http.configuration; http.etag.mode. + + + This output handler is used by http_cache_etag. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/outputhandlers/ob-inflatehandler.xml b/reference/http/functions/outputhandlers/ob-inflatehandler.xml new file mode 100644 index 0000000000..398689a0d5 --- /dev/null +++ b/reference/http/functions/outputhandlers/ob-inflatehandler.xml @@ -0,0 +1,125 @@ + + + + + + ob_inflatehandler + Inflate output handler + + + &reftitle.description; + + stringob_inflatehandler + stringdata + intmode + + + For use with ob_start. + + + Same restrictions as with ob_deflatehandler apply. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/parsers/http-parse-cookie.xml b/reference/http/functions/parsers/http-parse-cookie.xml new file mode 100644 index 0000000000..0d546ce3dc --- /dev/null +++ b/reference/http/functions/parsers/http-parse-cookie.xml @@ -0,0 +1,169 @@ + + + + + + http_parse_cookie + Parse HTTP cookie + + + &reftitle.description; + + objecthttp_parse_cookie + stringcookie + intflags + arrayallowed_extras + + + Parses HTTP cookies like sent in a response into a struct. + + + + &reftitle.parameters; + + + + cookie + + + String containing the value of a Set-Cookie response header + + + + + flags + + + Parse flags + + + + + allowed_extras + + + Array containing recognized extra keys. + By default all unkown keys will be treated as cookie names. + + + + + + + + &reftitle.returnvalues; + + Returns an stdClass olike shown in the example on success or FALSE on failure. + + + + + + + + + + + &reftitle.examples; + + + Using <function>http_parse_cookie</function> + + +]]> + + &example.outputs; + + Array + ( + [foo] => bar + [bar] => baz + ) + + [extras] => Array + ( + [comment] => + ) + + [flags] => 16 + [expires] => 0 + [path] => / + [domain] => example.com +) +]]> + + + + + + + + + + + + diff --git a/reference/http/functions/parsers/http-parse-headers.xml b/reference/http/functions/parsers/http-parse-headers.xml new file mode 100644 index 0000000000..88cee2005d --- /dev/null +++ b/reference/http/functions/parsers/http-parse-headers.xml @@ -0,0 +1,149 @@ + + + + + + http_parse_headers + Parse HTTP headers + + + &reftitle.description; + + arrayhttp_parse_headers + stringheader + + + Parses HTTP headers into an associative array. + + + + &reftitle.parameters; + + + + header + + + String containing HTTP headers + + + + + + + + &reftitle.returnvalues; + + Returns an array on success, or FALSE on failure. + + + + + + + + + + + &reftitle.examples; + + + Using <function>http_parse_headers</function> + + +]]> + + &example.outputs; + + text/html; chatset=UTF-8 + [Server] => Funky/1.0 + [Set-Cookie] => Array + ( + [0] => foo=bar + [1] => baz=quux + ) + [Folded] => works + too +) +]]> + + + + + + + + + + + + diff --git a/reference/http/functions/parsers/http-parse-message.xml b/reference/http/functions/parsers/http-parse-message.xml new file mode 100644 index 0000000000..a70c2d7645 --- /dev/null +++ b/reference/http/functions/parsers/http-parse-message.xml @@ -0,0 +1,158 @@ + + + + + + http_parse_message + Parse HTTP message + + + + &reftitle.description; + + objecthttp_parse_message + stringmessage + + + Parses (a) http_message(s) into a simple recursive object structure. + + + + &reftitle.parameters; + + + + message + + + String containing a single HTTP message or several consecutive HTTP messages + + + + + + + + &reftitle.returnvalues; + + Returns an hierarchical object structure of the parsed messages. + + + + + + + + + + + &reftitle.examples; + + + Using <function>http_parse_message</function> + + 3))); +?> +]]> + + &example.outputs; + + 2 + [httpVersion] => 1.1 + [responseCode] => 200 + [headers] => Array + ( + [Content-Length] => 3 + [Server] => Apache + ) + [body] => Hi! + [parentMessage] => stdClass object + ( + [type] => 2 + [httpVersion] => 1.1 + [responseCode] => 302 + [headers] => Array + ( + [Content-Length] => 0 + [Location] => ... + ) + [body] => + [parentMessage] => ... + ) +) +]]> + + + + + + + + + + + + diff --git a/reference/http/functions/parsers/http-parse-params.xml b/reference/http/functions/parsers/http-parse-params.xml new file mode 100644 index 0000000000..3a2f6d6685 --- /dev/null +++ b/reference/http/functions/parsers/http-parse-params.xml @@ -0,0 +1,155 @@ + + + + + + http_parse_params + Parse parameter list + + + &reftitle.description; + + objecthttp_parse_params + stringparam + intflags = HTTP_PARAMS_DEFAULT + + + Parse parameter list. + + + See the params parsing constants table for possible + values of the flags argument. + + + + &reftitle.parameters; + + + + param + + + Parameters + + + + + flags + + + Parse flags + + + + + + + + &reftitle.returnvalues; + + Returns parameter list. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/requests/http-get.xml b/reference/http/functions/requests/http-get.xml new file mode 100644 index 0000000000..c30458c0a0 --- /dev/null +++ b/reference/http/functions/requests/http-get.xml @@ -0,0 +1,375 @@ + + + + + + http_get + Perform GET request + + + &reftitle.description; + + stringhttp_get + stringurl + arrayoptions + arrayinfo + + + Performs an HTTP GET request on the supplied url. + + + The second parameter, if set, is expected to be an associative + array where the following options will be recognized: + + + + HTTP request options + + + + Name + Type + Description + + + + + redirectintwhether and how many redirects to follow + + + unrestrictedauthboolwhether to continue sending credentials on redirects to a different host + + + proxyhoststringproxy host in "host[:port]" format + + + proxyportintuse another proxy port as specified in proxyhost + + + proxytypeintHTTP_PROXY_HTTP, HTTP_PROXY_SOCKS4 or HTTP_PROXY_SOCKS5 + + + proxyauthstringproxy credentials in "user:pass" format + + + proxyauthtypeintHTTP_AUTH_BASIC and/or HTTP_AUTH_NTLM + + + httpauthstringhttp credentials in "user:pass" format + + + httpauthtypeintHTTP_AUTH_BASIC, HTTP_AUTH_DIGEST and/or HTTP_AUTH_NTLM + + + compressboolwhether to allow gzip/deflate content encoding + + + portintuse another port as specified in the url + + + refererstringthe referer to send + + + useragentstringthe user agent to send (defaults to PECL::HTTP/version (PHP/version))) + + + headersarraylist of custom headers as associative array like array("header" => "value") + + + cookiesarraylist of cookies as associative array like array("cookie" => "value") + + + encodecookiesboolwhether to urlencode the cookies (default: true) + + + cookiestorestringpath to a file where cookies are/will be stored + + + cookiesessionbooldon't load session cookies from cookiestore if TRUE + + + resumeintbyte offset to start the download from; if the server supports ranges + + + rangearrayarray of arrays, each containing two integers, specifying the ranges to download if server support is given; only recognized if the resume option is empty + + + maxfilesizeintmaximum file size that should be downloaded; has no effect, if the size of the requested entity is + + + lastmodifiedinttimestamp for If-(Un)Modified-Since header + + + etagstringquoted etag for If-(None-)Match header + + + timeoutintseconds the request may take + + + connecttimeoutintseconds the connect may take + + + onprogressmixedprogress callback + + + interfacestringoutgoing network interface (ifname, ip or hostname) + + + portrangearray2 integers specifying outgoing portrange to try + + + sslarray + + +
+ with the following options: + + + + Name + Type + Description + + + + + certstringpath to certificate + + + certtypestringtype of certificate + + + certpasswdstringpassword for certificate + + + keystringpath to key + + + keytypestringtype of key + + + keypasswdstringpasword for key + + + enginestringssl engine to use + + + versionintssl version to use + + + verifypeerboolwhether to verify the peer + + + verifyhostbool whether to verify the host + + + cipher_liststringlist of allowed ciphers + + + cainfostring + + + capathstring + + + random_filestring + + + egdsocketstring + + + +
+
+ + + + + + +
+ + &reftitle.parameters; + + + + url + + + URL + + + + + options + + + HTTP request options + + + + + info + + + Will be filled with request/response information + + + + 'http://www.example.com/', + 'response_code' => 302, + 'connect_code' => 0, + 'filetime' => -1, + 'total_time' => 0.212348, + 'namelookup_time' => 0.038296, + 'connect_time' => 0.104144, + 'pretransfer_time' => 0.104307, + 'starttransfer_time' => 0.212077, + 'redirect_time' => 0, + 'redirect_count' => 0, + 'size_upload' => 0, + 'size_download' => 218, + 'speed_download' => 1026, + 'speed_upload' => 0, + 'header_size' => 307, + 'request_size' => 103, + 'ssl_verifyresult' => 0, + 'ssl_engines' => + array ( + 0 => 'dynamic', + 1 => 'cswift', + 2 => 'chil', + 3 => 'atalla', + 4 => 'nuron', + 5 => 'ubsec', + 6 => 'aep', + 7 => 'sureware', + 8 => '4758cca', + ), + 'content_length_download' => 218, + 'content_length_upload' => 0, + 'content_type' => 'text/html', + 'httpauth_avail' => 0, + 'proxyauth_avail' => 0, + 'num_connects' => 1, + 'os_errno' => 0, + 'error' => '', +) +]]> + + + + + + + + + &reftitle.returnvalues; + + &returns.http.response; + + + + + + + + + + + + + + + +
+ + diff --git a/reference/http/functions/requests/http-head.xml b/reference/http/functions/requests/http-head.xml new file mode 100644 index 0000000000..8012ecf828 --- /dev/null +++ b/reference/http/functions/requests/http-head.xml @@ -0,0 +1,161 @@ + + + + + + http_head + Perform HEAD request + + + &reftitle.description; + + stringhttp_head + stringurl + arrayoptions + arrayinfo + + + Performs an HTTP HEAD request on the supplied url. + + &see.http.request.options; + + + &reftitle.parameters; + + + + url + + + URL + + + + + options + + + &link.http.request.options; + + + + + info + + + &link.http.request.info; + + + + + + + + &reftitle.returnvalues; + + &returns.http.response; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/requests/http-post-data.xml b/reference/http/functions/requests/http-post-data.xml new file mode 100644 index 0000000000..731eaaf8de --- /dev/null +++ b/reference/http/functions/requests/http-post-data.xml @@ -0,0 +1,170 @@ + + + + + + http_post_data + Perform POST request with pre-encoded data + + + &reftitle.description; + + stringhttp_post_data + stringurl + stringdata + arrayoptions + arrayinfo + + + Performs an HTTP POST request on the supplied url. + + &see.http.request.options; + + + &reftitle.parameters; + + + + url + + + URL + + + + + data + + + String containing the pre-encoded post data + + + + + options + + + &link.http.request.options; + + + + + info + + + &link.http.request.info; + + + + + + + + &reftitle.returnvalues; + + &returns.http.response; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/requests/http-post-fields.xml b/reference/http/functions/requests/http-post-fields.xml new file mode 100644 index 0000000000..1c0fb9da9a --- /dev/null +++ b/reference/http/functions/requests/http-post-fields.xml @@ -0,0 +1,179 @@ + + + + + + http_post_fields + Perform POST request with data to be encoded + + + &reftitle.description; + + stringhttp_post_fields + stringurl + arraydata + arrayfiles + arrayoptions + arrayinfo + + + Performs an HTTP POST request on the supplied url. + + &see.http.request.options; + + + &reftitle.parameters; + + + + url + + + URL + + + + + data + + + Associative array of POST values + + + + + files + + + Array of files to post + + + + + options + + + &link.http.request.options; + + + + + info + + + &link.http.request.info; + + + + + + + + &reftitle.returnvalues; + + &returns.http.response; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/requests/http-put-data.xml b/reference/http/functions/requests/http-put-data.xml new file mode 100644 index 0000000000..561f99dc54 --- /dev/null +++ b/reference/http/functions/requests/http-put-data.xml @@ -0,0 +1,170 @@ + + + + + + http_put_data + Perform PUT request with data + + + &reftitle.description; + + stringhttp_put_data + stringurl + stringdata + arrayoptions + arrayinfo + + + Performs an HTTP PUT request on the supplied url. + + &see.http.request.options; + + + &reftitle.parameters; + + + + url + + + URL + + + + + data + + + PUT request body + + + + + options + + + &link.http.request.options; + + + + + info + + + &link.http.request.info; + + + + + + + + &reftitle.returnvalues; + + &returns.http.response; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/requests/http-put-file.xml b/reference/http/functions/requests/http-put-file.xml new file mode 100644 index 0000000000..2959dbf060 --- /dev/null +++ b/reference/http/functions/requests/http-put-file.xml @@ -0,0 +1,170 @@ + + + + + + http_put_file + Perform PUT request with file + + + &reftitle.description; + + stringhttp_put_file + stringurl + stringfile + arrayoptions + arrayinfo + + + Performs an HTTP PUT request on the supplied url. + + &see.http.request.options; + + + &reftitle.parameters; + + + + url + + + URL + + + + + file + + + The file to put + + + + + options + + + &link.http.request.options; + + + + + info + + + &link.http.request.info; + + + + + + + + &reftitle.returnvalues; + + &returns.http.response; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/requests/http-put-stream.xml b/reference/http/functions/requests/http-put-stream.xml new file mode 100644 index 0000000000..180583b197 --- /dev/null +++ b/reference/http/functions/requests/http-put-stream.xml @@ -0,0 +1,170 @@ + + + + + + http_put_stream + Perform PUT request with stream + + + &reftitle.description; + + stringhttp_put_stream + stringurl + resourcestream + arrayoptions + arrayinfo + + + Performs an HTTP PUT request on the supplied url. + + &see.http.request.options; + + + &reftitle.parameters; + + + + url + + + URL + + + + + stream + + + The stream to read the PUT request body from + + + + + options + + + &link.http.request.options; + + + + + info + + + &link.http.request.info; + + + + + + + + &reftitle.returnvalues; + + &returns.http.response; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/requests/http-request-body-encode.xml b/reference/http/functions/requests/http-request-body-encode.xml new file mode 100644 index 0000000000..edf0d838f7 --- /dev/null +++ b/reference/http/functions/requests/http-request-body-encode.xml @@ -0,0 +1,153 @@ + + + + + + http_request_body_encode + Encode request body + + + &reftitle.description; + + stringhttp_request_body_encode + arrayfields + arrayfiles + + + + Generate x-www-form-urlencoded resp. form-data encoded request body. + + + + + &reftitle.parameters; + + + + fields + + + POST fields + + + + + files + + + POST files + + + + + + + + &reftitle.returnvalues; + + Returns encoded string on success, or FALSE on failure + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/requests/http-request-method-exists.xml b/reference/http/functions/requests/http-request-method-exists.xml new file mode 100644 index 0000000000..9b1b4551fa --- /dev/null +++ b/reference/http/functions/requests/http-request-method-exists.xml @@ -0,0 +1,142 @@ + + + + + + http_request_method_exists + Check whether request method exists + + + &reftitle.description; + + inthttp_request_method_exists + mixedmethod + + + Check if a request method is registered (or available by default). + + + + &reftitle.parameters; + + + + method + + + request method name or ID + + + + + + + + &reftitle.returnvalues; + + Returns &true; if the request method is known, else &false;. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/requests/http-request-method-name.xml b/reference/http/functions/requests/http-request-method-name.xml new file mode 100644 index 0000000000..4e4ebff0d7 --- /dev/null +++ b/reference/http/functions/requests/http-request-method-name.xml @@ -0,0 +1,142 @@ + + + + + + http_request_method_name + Get request method name + + + &reftitle.description; + + stringhttp_request_method_name + intmethod + + + Get the literal string representation of a standard or registered request method. + + + + &reftitle.parameters; + + + + method + + + request method ID + + + + + + + + &reftitle.returnvalues; + + Returns the request method name as string on success, or &false; on failure. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/requests/http-request-method-register.xml b/reference/http/functions/requests/http-request-method-register.xml new file mode 100644 index 0000000000..a920a84338 --- /dev/null +++ b/reference/http/functions/requests/http-request-method-register.xml @@ -0,0 +1,142 @@ + + + + + + http_request_method_register + Register request method + + + &reftitle.description; + + inthttp_request_method_register + stringmethod + + + Register a custom request method. + + + + &reftitle.parameters; + + + + method + + + the request method name to register + + + + + + + + &reftitle.returnvalues; + + Returns the ID of the request method on success, or FALSE on failure. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/requests/http-request-method-unregister.xml b/reference/http/functions/requests/http-request-method-unregister.xml new file mode 100644 index 0000000000..7b8ab1ad90 --- /dev/null +++ b/reference/http/functions/requests/http-request-method-unregister.xml @@ -0,0 +1,144 @@ + + + + + + http_request_method_unregister + Unregister request method + + + &reftitle.description; + + boolhttp_request_method_unregister + mixedmethod + + + + Unregister a previously registered custom request method. + + + + + &reftitle.parameters; + + + + method + + + he request method name or ID + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/requests/http-request.xml b/reference/http/functions/requests/http-request.xml new file mode 100644 index 0000000000..8b4cca9978 --- /dev/null +++ b/reference/http/functions/requests/http-request.xml @@ -0,0 +1,180 @@ + + + + + + http_request + Perform custom request + + + &reftitle.description; + + stringhttp_request + intmethod + stringurl + stringbody + arrayoptions + arrayinfo + + + Performs a custom HTTP request on the supplied url. + + &see.http.request.options; + + + + &reftitle.parameters; + + + + method + + + Request method + + + + + url + + + URL + + + + + body + + + Request body + + + + + options + + + &link.http.request.options; + + + + + info + + + &link.http.request.info; + + + + + + + + &reftitle.returnvalues; + + &returns.http.response; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/responses/http-redirect.xml b/reference/http/functions/responses/http-redirect.xml new file mode 100644 index 0000000000..13897dab15 --- /dev/null +++ b/reference/http/functions/responses/http-redirect.xml @@ -0,0 +1,206 @@ + + + + + + http_redirect + Issue HTTP redirect + + + &reftitle.description; + + voidhttp_redirect + stringurl + arrayparams + boolsession = FALSE + intstatus + + + + Redirect to the given url. + + + The supplied url will be expanded with http_build_url, the params array will + be treated with http_build_str and the session identification will be appended + if session is true. + + + The HTTP response code will be set according to status. + + + You can use one of the redirect constants for convenience. + + + Please see RFC 2616 + for which redirect response code to use in which situation. + + + By default PHP will decide which response status fits best. + + + To be RFC compliant, "Redirecting to <a>URL</a>." will be displayed, + if the client doesn't redirect immediately, and the request method was + another one than HEAD. + + + A log entry will be written to the redirect log, if the &link.http.configuration; + http.log.redirect is set and the redirect attempt was successful. + + + + + &reftitle.parameters; + + + + url + + + the URL to redirect to + + + + + params + + + associative array of query parameters + + + + + session + + + whether to append session information + + + + + false + + + Its description + + + + + status + + + custom response status code + + + + + + + + &reftitle.returnvalues; + + Returns &false; on failure, or exits on success. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/responses/http-send-content-disposition.xml b/reference/http/functions/responses/http-send-content-disposition.xml new file mode 100644 index 0000000000..d736a995f2 --- /dev/null +++ b/reference/http/functions/responses/http-send-content-disposition.xml @@ -0,0 +1,156 @@ + + + + + + http_send_content_disposition + Send Content-Disposition + + + &reftitle.description; + + boolhttp_send_content_disposition + stringfilename + boolinline = FALSE + + + + Send the Content-Disposition. The Content-Disposition header is very useful + if the data actually sent came from a file or something similar, that should + be "saved" by the client/user (i.e. by browsers "Save as..." popup window). + + + + + &reftitle.parameters; + + + + filename + + + the file name the "Save as..." dialog should display + + + + + inline + + + if set to true and the user agent knows how to handle the content type, + it will probably not cause the popup window to be shown + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/responses/http-send-content-type.xml b/reference/http/functions/responses/http-send-content-type.xml new file mode 100644 index 0000000000..5adb53ba39 --- /dev/null +++ b/reference/http/functions/responses/http-send-content-type.xml @@ -0,0 +1,145 @@ + + + + + + http_send_content_type + Send Content-Type + + + &reftitle.description; + + boolhttp_send_content_type + stringcontent_type = 'application/x-octetstream' + + + + Send the Content-Type of the sent entity. This is particularly important + if you use the http_send API. + + + + + &reftitle.parameters; + + + + content_type + + + the desired content type (primary/secondary) + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/responses/http-send-data.xml b/reference/http/functions/responses/http-send-data.xml new file mode 100644 index 0000000000..47e9655a9a --- /dev/null +++ b/reference/http/functions/responses/http-send-data.xml @@ -0,0 +1,144 @@ + + + + + + http_send_data + Send arbitrary data + + + &reftitle.description; + + boolhttp_send_data + stringdata + + + + Sends raw data with support for (multiple) range requests. + + + + + &reftitle.parameters; + + + + data + + + data to send + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/responses/http-send-file.xml b/reference/http/functions/responses/http-send-file.xml new file mode 100644 index 0000000000..9dc385e35b --- /dev/null +++ b/reference/http/functions/responses/http-send-file.xml @@ -0,0 +1,144 @@ + + + + + + http_send_file + Send file + + + &reftitle.description; + + boolhttp_send_file + stringfile + + + + Sends a file with support for (multiple) range requests. + + + + + &reftitle.parameters; + + + + file + + + the file to send + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/responses/http-send-last-modified.xml b/reference/http/functions/responses/http-send-last-modified.xml new file mode 100644 index 0000000000..66a10c0fd4 --- /dev/null +++ b/reference/http/functions/responses/http-send-last-modified.xml @@ -0,0 +1,145 @@ + + + + + + http_send_last_modified + Send Last-Modified + + + &reftitle.description; + + boolhttp_send_last_modified + inttimestamp + + + + Send a Last-Modified header with a valid HTTP date. + + + + + &reftitle.parameters; + + + + timestamp + + + a unix timestamp, converted it to a valid HTTP date; + if omitted, the current time will be sent + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/responses/http-send-status.xml b/reference/http/functions/responses/http-send-status.xml new file mode 100644 index 0000000000..97a39b6182 --- /dev/null +++ b/reference/http/functions/responses/http-send-status.xml @@ -0,0 +1,144 @@ + + + + + + http_send_status + Send status + + + &reftitle.description; + + boolhttp_send_status + intstatus + + + + Send HTTP status code. + + + + + &reftitle.parameters; + + + + status + + + HTTP status code + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/responses/http-send-stream.xml b/reference/http/functions/responses/http-send-stream.xml new file mode 100644 index 0000000000..8e67270c28 --- /dev/null +++ b/reference/http/functions/responses/http-send-stream.xml @@ -0,0 +1,144 @@ + + + + + + http_send_stream + Send stream + + + &reftitle.description; + + boolhttp_send_stream + resourcestream + + + + Sends an already opened stream with support for (multiple) range requests. + + + + + &reftitle.parameters; + + + + stream + + + stream to read from (must be seekable) + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/responses/http-throttle.xml b/reference/http/functions/responses/http-throttle.xml new file mode 100644 index 0000000000..98e309bde5 --- /dev/null +++ b/reference/http/functions/responses/http-throttle.xml @@ -0,0 +1,142 @@ + + + + + + http_throttle + HTTP throttling + + + &reftitle.description; + + voidhttp_throttle + doublesec + intbytes = 40960 + + + + Sets the throttle delay and send buffer size for use with http_send() API. + Provides a basic throttling mechanism, which will yield the current process + resp. thread until the entity has been completely sent, though. + + + + + &reftitle.parameters; + + + + sec + + + seconds too sleep after each chunk sent + + + + + bytes + + + the chunk size in bytes + + + + + + + + + + + + + + + &reftitle.examples; + + + A <function>http_throttle</function> example + + Send file with approximately 20 kbyte/s. + + + +?> +]]> + + + + + + + + + + + + diff --git a/reference/http/functions/setcookie.xml b/reference/http/functions/setcookie.xml deleted file mode 100644 index 670e3fad8b..0000000000 --- a/reference/http/functions/setcookie.xml +++ /dev/null @@ -1,371 +0,0 @@ - - - - - - setcookie - Send a cookie - - - Description - - boolsetcookie - stringname - stringvalue - intexpire - stringpath - stringdomain - boolsecure - - - setcookie defines a cookie to be sent along - with the rest of the HTTP headers. Like other headers, cookies - must be sent before any output from your - script (this is a protocol restriction). This requires that you - place calls to this function prior to any output, including - <html> and <head> tags - as well as any whitespace. If output exists prior to calling this - function, setcookie will fail and return &false;. - If setcookie successfully runs, it will return - &true;. This does not indicate whether the user accepted the cookie. - - - - As of PHP 4, you can use output buffering to send output prior to the - call of this function, with the overhead of all of your output to the - browser being buffered in the server until you send it. You can do this - by calling ob_start and - ob_end_flush in your script, or setting the - output_buffering configuration directive on in your - &php.ini; or server configuration files. - - - - All the arguments except the name argument - are optional. You may also replace an argument with an empty string - ("") in order to skip that - argument. Because the expire - argument is integer, it cannot - be skipped with an empty string, use a zero (0) - instead. The following table explains each parameter of the - setcookie function, be sure to read the - Netscape cookie specification for - specifics on how each setcookie parameter works - and RFC 2965 for additional - information on how HTTP cookies work. - - - - <function>setcookie</function> parameters explained - - - - Parameter - Description - Examples - - - - - name - - The name of the cookie. - - - 'cookiename' is called as $_COOKIE['cookiename'] - - - - value - - The value of the cookie. This value is stored on the clients - computer; do not store sensitive information. - - - Assuming the name is 'cookiename', this - value is retrieved through $_COOKIE['cookiename'] - - - - expire - - The time the cookie expires. This is a Unix timestamp so is - in number of seconds since the epoch. In other words, you'll - most likely set this with the time function - plus the number of seconds before you want it to expire. Or - you might use mktime. - - - time()+60*60*24*30 will set the cookie to - expire in 30 days. If not set, the cookie will expire at - the end of the session (when the browser closes). - - - - path - - The path on the server in which the cookie will be available on. - - - If set to '/', the cookie will be available - within the entire domain. If set to - '/foo/', the cookie will only be available - within the /foo/ directory and all - sub-directories such as /foo/bar/ of - domain. The default value is the - current directory that the cookie is being set in. - - - - domain - - The domain that the cookie is available. - - - To make the cookie available on all subdomains of example.com - then you'd set it to '.example.com'. The - . is not required but makes it compatible - with more browsers. Setting it to www.example.com - will make the cookie only available in the www - subdomain. Refer to tail matching in the - spec for details. - - - - secure - - Indicates that the cookie should only be transmitted over a - secure HTTPS connection. When set to &true;, the - cookie will only be set if a secure connection exists. The default - is &false;. - - - 0 or 1 - - - - -
-
- - Once the cookies have been set, they can be accessed on the next page load - with the $_COOKIE or - $HTTP_COOKIE_VARS arrays. Note, - autoglobals - such as $_COOKIE became available in PHP - 4.1.0. - $HTTP_COOKIE_VARS has existed since PHP 3. Cookie - values also exist in - $_REQUEST. - - - - If the PHP directive register_globals - is set to on then cookie values will also be made into - variables. In our examples below, $TestCookie will - exist. It's recommended to use $_COOKIE. - - - - Common Pitfalls: - - - - Cookies will not become visible until the next loading of a page that - the cookie should be visible for. To test if a cookie was successfully - set, check for the cookie on a next loading page before the cookie - expires. Expire time is set via the expire - parameter. A nice way to debug the existence of cookies is by - simply calling print_r($_COOKIE);. - - - - - Cookies must be deleted with the same parameters as they were set with. - If the value argument is an empty string, or &false;, and all other arguments - match a previous call to setcookie, then the cookie with the specified - name will be deleted from the remote client. - - - - - Because setting a cookie with a value of &false; will try to delete the cookie, - you should not use boolean values. Instead, use 0 for &false; - and 1 for &true;. - - - - - Cookies names can be set as array names and will be available to your - PHP scripts as arrays but separate cookies are stored on the users - system. Consider explode to set one cookie with - multiple names and values. It is not recommended to use - serialize for this purpose, because it can result - in security holes. - - - - - - In PHP 3, multiple calls to setcookie in the same - script will be performed in reverse order. If you are trying to - delete one cookie before inserting another you should put the - insert before the delete. As of PHP 4, multiple calls to - setcookie are performed in the order called. - - - Some examples follow how to send cookies: - - <function>setcookie</function> send example - - -]]> - - - - - Note that the value portion of the cookie will automatically be - urlencoded when you send the cookie, and when it is received, it - is automatically decoded and assigned to a variable by the same - name as the cookie name. If you don't want this, you can use - setrawcookie instead if you are using PHP 5. To see - the contents of our test cookie in a script, simply use one of the - following examples: - - - - - -]]> - - - - - When deleting a cookie you should assure that the expiration date - is in the past, to trigger the removal mechanism in your browser. - Examples follow how to delete cookies sent in previous example: - - - - <function>setcookie</function> delete example - - -]]> - - - - - You may also set array cookies by using array notation in the - cookie name. This has the effect of setting as many cookies as - you have array elements, but when the cookie is received by your - script, the values are all placed in an array with the cookie's - name: - - - - <function>setcookie</function> and arrays - - $value) { - echo "$name : $value
\n"; - } -} -?> -]]> -
- - which prints - - - - -
-
- - - The following RFC's may also be useful: - RFC 2109 and - RFC 2695 - - - You may notice the expire parameter takes on a - Unix timestamp, as opposed to the date format Wdy, DD-Mon-YYYY - HH:MM:SS GMT, this is because PHP does this conversion - internally. - - - expire is compared to the client's time which can - differ from server's time. - - - - - Microsoft Internet Explorer 4 with Service Pack 1 applied does - not correctly deal with cookies that have their path parameter - set. - - - Netscape Communicator 4.05 and Microsoft Internet Explorer 3.x - appear to handle cookies incorrectly when the path and time - are not set. - - - - See also header, setrawcookie - and the cookies section. - -
-
- - diff --git a/reference/http/functions/setrawcookie.xml b/reference/http/functions/setrawcookie.xml deleted file mode 100644 index dda6f9afd1..0000000000 --- a/reference/http/functions/setrawcookie.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - setrawcookie - Send a cookie without urlencoding the cookie value - - - Description - - boolsetrawcookie - stringname - stringvalue - intexpire - stringpath - stringdomain - boolsecure - - - setrawcookie is exactly the same as - setcookie except that the cookie value will not - be automatically urlencoded when sent to the browser. - - - See also header, setcookie and the - cookies section. - - - - - diff --git a/reference/http/functions/urls/http-build-str.xml b/reference/http/functions/urls/http-build-str.xml new file mode 100644 index 0000000000..53bc029111 --- /dev/null +++ b/reference/http/functions/urls/http-build-str.xml @@ -0,0 +1,162 @@ + + + + + + http_build_str + Build query string + + + &reftitle.description; + + stringhttp_build_str + arrayquery + stringprefix + stringarg_separator + + + + Opponent to parse_str(). + + + + + &reftitle.parameters; + + + + query + + + associative array of query string parameters + + + + + prefix + + + top level prefix + + + + + arg_separator + + + argument separator to use (by default the INI setting arg_separator.output will be used, or "&" if neither is set + + + + + + + + &reftitle.returnvalues; + + Returns the built query as string on success or &false; on failure. + + + + + + + + + + + + + + + + + + diff --git a/reference/http/functions/urls/http-build-url.xml b/reference/http/functions/urls/http-build-url.xml new file mode 100644 index 0000000000..11f394eae4 --- /dev/null +++ b/reference/http/functions/urls/http-build-url.xml @@ -0,0 +1,174 @@ + + + + + + http_build_url + Build an URL + + + &reftitle.description; + + stringhttp_build_url + mixedurl + mixedparts + intflags = HTTP_URL_REPLACE + arraynew_url + + + + Build an URL. + + + The parts of the second URL will be merged into the first according to the flags argument. + + + + + &reftitle.parameters; + + + + url + + + (part(s) of) an URL in form of a string or associative array like parse_url returns + + + + + parts + + + same as the first argument + + + + + flags + + + a bitmask of binary or'ed HTTP_URL constants; + HTTP_URL_REPLACE is the default + + + + + new_url + + + if set, it will be filled with the parts of the composed url like parse_url would return + + + + + + + + &reftitle.returnvalues; + + Returns the new URL as string on success or &false; on failure. + + + + + + + + + + + &reftitle.examples; + + + A <function>http_build_url</function> example + + "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 +); +?> +]]> + + &example.outputs; + + + + + + + + + + + + + +