X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=docs%2Ffunctions.html;h=e44c943d97bd552c9f16ec0599f07c49994ff4de;hb=04403e78125a72f38fcd145a8dc0809e348e39d3;hp=d00adae33987548fd6e00520bc1cbc6cc66439dd;hpb=f2d1bcbb220370bc25bcd3a7272dd20da57b3058;p=m6w6%2Fext-http diff --git a/docs/functions.html b/docs/functions.html index d00adae..e44c943 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -205,8 +205,7 @@ array where the following keys will be recognized:

 - redirect:
  - lastmodified:     int, timestamp for If-(Un)Modified-Since header
- timeout: int, seconds the request may take
- connecttimeout: int, seconds the connect may take
- - onprogress: mixed, progress callback
- - ondebug: mixed, debug callback

The optional third parameter will be filled with some additional information
+ - onprogress: mixed, progress callback

The optional third parameter will be filled with some additional information
in form af an associative array, if supplied, like the following example:


<?php
array (
    
'effective_url' => 'http://localhost',
    
'response_code' => 403,
    
'total_time' => 0.017,
    
'namelookup_time' => 0.013,
    
'connect_time' => 0.014,
    
'pretransfer_time' => 0.014,
    
'size_upload' => 0,
    
'size_download' => 202,
    
'speed_download' => 11882,
    
'speed_upload' => 0,
    
'header_size' => 145,
    
'request_size' => 62,
    
'ssl_verifyresult' => 0,
    
'filetime' => -1,
    
'content_length_download' => 202,
    
'content_length_upload' => 0,
    
'starttransfer_time' => 0.017,
    
'content_type' => 'text/html; charset=iso-8859-1',
    
'redirect_time' => 0,
    
'redirect_count' => 0,
    
'private' => '',
    
'http_connectcode' => 0,
    
'httpauth_avail' => 0,
    
'proxyauth_avail' => 0,
)
?>

@@ -410,6 +409,8 @@ Affects only PUT requests.

See http_get() for a full list of returned info.

HttpMessage HttpRequest::getResponseMessage()

Get the full response as HttpMessage object.

+

HttpMessage HttpRequest::getRequestMessage()

+

Get sent HTTP message.

bool HttpRequest::send()

Send the HTTP request.

@@ -430,7 +431,7 @@ GET example:


able to send several HttpRequests in parallel.

Example:


-<?php
    $urls
= array('www.php.net', 'pecl.php.net', 'pear.php.net')
    
$pool = new HttpRequestPool;
    foreach (
$urls as $url) {
        
$req[$url] = new HttpRequest("http://$url", HTTP_HEAD);
        
$pool->attach($req[$url]);
    }
    
$pool->send();
    foreach (
$urls as $url) {
        
printf("%s (%s) is %s\n",
            
$url, $req[$url]->getResponseInfo('effective_url'),
            
$r->getResponseCode() == 200 ? 'alive' : 'not alive'
        
);
    }
?>
+<?php
try {
    
$pool = new HttpRequestPool(
        new
HttpRequest('http://www.google.com/', HTTP_HEAD),
        new
HttpRequest('http://www.php.net/', HTTP_HEAD)
    );
    
$pool->send();
    foreach(
$pool as $request) {
        
printf("%s is %s (%d)\n",
            
$request->getUrl(),
            
$request->getResponseCode() ? 'alive' : 'not alive',
            
$request->getResponseCode()
        );
    }
} catch (
HttpException $e) {
    echo
$e;
}
?>



@@ -457,6 +458,16 @@ NOTE: set all options prior attaching!

See HttpRequestPool::socketSend().

protected void HttpRequestPool::socketRead()

See HttpRequestPool::socketSend().

+

bool HttpRequestPool::valid()

+

Implements Iterator::valid().

+

HttpRequest HttpRequestPool::current()

+

Implements Iterator::current().

+

long HttpRequestPool::key()

+

Implements Iterator::key().

+

void HttpRequestPool::next()

+

Implements Iterator::next().

+

void HttpRequestPool::rewind()

+

Implements Iterator::rewind().


http_response_object.c

static bool HttpResponse::setCache(bool cache)

@@ -531,7 +542,7 @@ Example:




-

Generated at: Fri, 22 Jul 2005 17:44:59 +0200

+

Generated at: Mon, 01 Aug 2005 09:46:36 +0200