update : 2015.11.03
php.shukuma.com

검색:
 
 
Set calling contexts

Yar_Client::setOpt

(PECL yar >= 1.0.0)

Yar_Client::setOptSet calling contexts

설명

public boolean Yar_Client::setOpt ( number $name , mixed $value )

인수

name

it can be: YAR_OPT_PACKAGER, YAR_OPT_PERSISTENT (Need server support), YAR_OPT_TIMEOUT, YAR_OPT_CONNECT_TIMEOUT

value

반환값

예제

Example #1 Yar_Client::setOpt() example

<?php

$cient 
= new Yar_Client("http://host/api/");

//Set timeout to 1s
$client->SetOpt(YAR_OPT_CONNECT_TIMEOUT1000);

//Set packager to JSON
$client->SetOpt(YAR_OPT_PACKAGER"json");

/* call remote service */
$result $client->some_method("parameter");
?>

위 예제의 출력 예시:

참고