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

search for in the

HttpRequestPool::__destruct> <HttpRequestPool::attach
Last updated: Fri, 30 Jan 2009

view this page in

HttpRequestPool::__construct

(PECL pecl_http >= 0.10.0)

HttpRequestPool::__constructHttpRequestPool のコンストラクタ

説明

void HttpRequestPool::__construct ([ HttpRequest $request ] )

新しい HttpRequestPool オブジェクトのインスタンスを作成します。 HttpRequestPool は、複数の HttpRequest を平行して送信することができます。

事実上無限にオプションのパラメータを指定することができます。 各パラメータは HttpRequest オブジェクトへの参照です。

パラメータ

request

アタッチする HttpRequest オブジェクト。

エラー / 例外

HttpRequestPoolException (HttpRequestException、HttpInvalidParamException) をスローします。

例1 HttpRequestPool の例

<?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
There are no user contributed notes for this page.

HttpRequestPool::__destruct> <HttpRequestPool::attach
Last updated: Fri, 30 Jan 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites