...
|
...
|
@@ -240,4 +240,22 @@ class Yohobuy |
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* rpc调用远程服务(YAR)
|
|
|
*
|
|
|
* @see http://php.net/manual/zh/yar-client.setopt.php
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function yarClient($uri, $method, $data = array(), $timeout = 3000)
|
|
|
{
|
|
|
$client = new \Yar_Client($uri);
|
|
|
$client->SetOpt(YAR_OPT_PACKAGER, 'php');
|
|
|
$client->SetOpt(YAR_OPT_TIMEOUT, $timeout);
|
|
|
$client->SetOpt(YAR_OPT_CONNECT_TIMEOUT, $timeout);
|
|
|
|
|
|
$result = $client->$method($data);
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|