X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=docs%2Ffunctions.html;h=e1329bb6d9034cea8ed295454eae73dda45a755c;hp=1503d1a33ada8f096e9caa237a4bf1888c9d2d24;hb=7ba82df3144551af4182de7e515f955b9b1a68a9;hpb=19ad90d1f12058345ceb651b4bed6ff0f298dd08 diff --git a/docs/functions.html b/docs/functions.html index 1503d1a..e1329bb 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -179,7 +179,7 @@ a "304 Not Modified" status code is issued.

string ob_etaghandler(string data, int mode)

For use with ob_start(). Output buffer handler generating an ETag with
the hash algorythm specified with the INI setting "http.etag_mode".

-

void http_throttle(double sec[, int bytes = 2097152])

+

void http_throttle(double sec[, int bytes = 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.

@@ -270,7 +270,7 @@ array where the following keys will be recognized:

 - redirect:
  - compress:         bool, whether to allow gzip/deflate content encoding
(defaults to true)
- port: int, use another port as specified in the url
- - referer: string, the referer to sends
+ - referer: string, the referer to send
- useragent: string, the user agent to send
(defaults to PECL::HTTP/version (PHP/version)))
- headers: array, list of custom headers as associative array
@@ -337,6 +337,60 @@ See http_get() for a full list of available options.

Returns the request method name as string on success, or FALSE on failure.

string http_build_query(mixed formdata [, string prefix[, string arg_separator]])

Generates a form-encoded query string from an associative array or object.

+

string http_gzencode(string data[, int level = -1])

+

Compress data with the HTTP compatible GZIP encoding.

+

Expects the first parameter to be a string which contains the data that
+should be encoded. Additionally accepts an optional in paramter specifying
+the compression level, where -1 is default, 0 is no compression and 9 is
+best compression ratio.

+

Returns the encoded string on success, or NULL on failure.

+

string http_gzdecode(string data)

+

Uncompress data compressed with the HTTP compatible GZIP encoding.

+

Expects a string as parameter containing the compressed data.

+

Returns the decoded string on success, or NULL on failure.

+

string http_deflate(string data[, int level = -1])

+

Compress data with the HTTP compatible DEFLATE encoding.

+

Expects the first parameter to be a string containing the data that should
+be encoded. Additionally accepts an optional int parameter specifying the
+compression level, where -1 is default, 0 is no compression and 9 is best
+compression ratio.

+

Returns the encoded string on success, or NULL on failure.

+

string http_inflate(string data)

+

Uncompress data compressed with the HTTP compatible DEFLATE encoding.

+

Expects a string as parameter containing the compressed data.

+

Returns the decoded string on success, or NULL on failure.

+

string http_compress(string data[, int level = -1])

+

Compress data with the HTTP compatible COMPRESS encoding.

+

Expects the first parameter to be a string containing the data which should
+be encoded. Additionally accepts an optional int parameter specifying the
+compression level, where -1 is default, 0 is no compression and 9 is best
+compression ratio.

+

Returns the encoded string on success, or NULL on failure.

+

string http_uncompress(string data)

+

Uncompress data compressed with the HTTP compatible COMPRESS encoding.

+

Expects a string as parameter containing the compressed data.

+

Returns the decoded string on success, or NULL on failure.

+

int http_support([int feature = 0])

+

Check for feature that require external libraries.

+

Accpepts an optional in parameter specifying which 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.

+

Available features to probe for are:
+

+

Returns int, whether requested feature is supported, or a bitmask with
+all supported features.


http_message_object.c

HttpMessage

@@ -429,11 +483,12 @@ should also contain any parent messages.


http_request_object.c

HttpRequest

-

void HttpRequest::__construct([string url[, int request_method = HTTP_METH_GET]])

+

void HttpRequest::__construct([string url[, int request_method = HTTP_METH_GET[, array options]]])

Instantiate a new HttpRequest object.

Accepts a string as optional parameter containing the target request url.
Additianally accepts an optional int parameter specifying the request method
-to use.

+to use and an associative array as optional third parameter which will be
+passed to HttpRequest::setOptions().

Throws HttpException.

void HttpRequest::__destruct()

Destroys the HttpRequest object.

@@ -707,7 +762,7 @@ HttpRequestPoolException, HttpMalformedHeaderException.

protected bool HttpRequestPool::socketPerform()

Returns TRUE until each request has finished its transaction.

Usage:


-<?php
    
while ($pool->socketPerform()) {
        
do_something_else();
        if (!
$pool->socketSelect()) {
            die(
'Socket error');
        }
    }
?>
+<?php
class MyPool extends HttpRequestPool
{
    public function 
send()
    {
        while (
$this->socketPerform()) {
            if (!
$this->socketSelect()) {
                throw new 
HttpSocketExcpetion;
            }
        }
    }
    
    protected final function 
socketPerform()
    {
        
$result parent::socketPerform();
        foreach (
$this->getFinishedRequests() as $r) {
            
$this->detach($r);
            
// handle response of finished request
        
}
        return 
$result;
    }

?>

protected bool HttpRequestPool::socketSelect()

@@ -723,6 +778,13 @@ HttpRequestPoolException, HttpMalformedHeaderException.

Implements Iterator::next().

void HttpRequestPool::rewind()

Implements Iterator::rewind().

+

array HttpRequestPool::getAttachedRequests()

+

Get attached HttpRequest objects.

+

Returns an array containing all currently attached HttpRequest objects.

+

array HttpRequestPool::getFinishedRequests()

+

Get attached HttpRequest objects that already have finished their work.

+

Returns an array containing all attached HttpRequest objects that
+already have finished their work.


http_response_object.c

static bool HttpResponse::setHeader(string name, mixed value[, bool replace = true])

@@ -953,6 +1015,20 @@ http.cache_log is set.

  • http_build_query
  • +
  • http_gzencode +
  • +
  • http_gzdecode +
  • +
  • http_deflate +
  • +
  • http_inflate +
  • +
  • http_compress +
  • +
  • http_uncompress +
  • +
  • http_support +
  • http_message_object.c @@ -1044,6 +1120,8 @@ http.cache_log is set.

  • HttpRequestPool::key()
  • HttpRequestPool::next()
  • HttpRequestPool::rewind()
  • +
  • HttpRequestPool::getAttachedRequests()
  • +
  • HttpRequestPool::getFinishedRequests()
  • @@ -1083,7 +1161,7 @@ http.cache_log is set.

    -

    Generated at: Wed, 05 Oct 2005 15:34:24 +0000

    +

    Generated at: Fri, 04 Nov 2005 12:29:06 +0100