downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

HttpRequestPool::__destruct> <HttpRequestPool::attach
[edit] Last updated: Fri, 17 May 2013

view this page in

HttpRequestPool::__construct

(PECL pecl_http >= 0.10.0)

HttpRequestPool::__constructHttpRequestPool constructor

Descrizione

public HttpRequestPool::__construct ([ HttpRequest $request [, HttpRequest $... ]] )

Instantiate a new HttpRequestPool object. An HttpRequestPool is able to send several HttpRequests in parallel.

Accepts virtually infinite optional parameters each referencing an HttpRequest object.

Elenco dei parametri

request

HttpRequest object to attach

...

Errori/Eccezioni

Throws HttpRequestPoolException (HttpRequestException, HttpInvalidParamException).

Esempi

Example #1 A HttpRequestPool example

<?php
try {
    
$pool = new HttpRequestPool(
        new 
HttpRequest('http://www.google.com/'HttpRequest::METH_HEAD),
        new 
HttpRequest('http://www.php.net/'HttpRequest::METH_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;
}
?>



add a note add a note User Contributed Notes HttpRequestPool::__construct - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites