yar.php
class API {
/**
* the doc info will be generated automatically into service info page.
* @params
* @return
*/
public function api($parameter='', $option = "foo") {
return $parameter;
}
/**
* generated
* @return
*/
protected function client_can_not_see() {
}
}
$service = new Yar_Server(new API());
$service->handle();
client.php
$client = new Yar_Client("");
$param = 'hello';
$ret = $client->api($param);
var_dump($ret);
如果在yar.php中出现报错,将会在client.php中报以下错误:
PHP Fatal error: Uncaught exception 'Yar_Client_Protocol_Exception' with message 'malformed response header '
阅读(4726) | 评论(0) | 转发(0) |