Forum und email

http_persistent_handles_ident

(PECL pecl_http:1.5.0-1.5.5)

http_persistent_handles_ident — 持続ハンドルの ident を取得/設定する

説明

string http_persistent_handles_ident ( string $ident )

持続ハンドルの ident を取得あるいは定義します。

パラメータ

ident

識別文字列。

返り値

成功した場合に以前の ident、 失敗した場合に FALSE を返します。

Example#1 http_persistent_handles_ident() の例

<?php
echo http_persistent_handles_ident("CUSTOM"), "\n";
echo 
http_persistent_handles_ident("MyApp1"), "\n";
http_get("https://www.example.com/");
print_r(http_persistent_handles_count());
?>

上の例の出力は以下となります。

GLOBAL
CUSTOM
stdClass Object
(
    [http_request] => Array
        (
            [MyApp1] => Array
                (
                    [used] => 0
                    [free] => 1
                )

        )

    [http_request_datashare] => Array
        (
            [GLOBAL] => Array
                (
                    [used] => 1
                    [free] => 0
                )

        )

    [http_request_pool] => Array
        (
        )

)