Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2001481
  • 博文数量: 433
  • 博客积分: 918
  • 博客等级: 准尉
  • 技术积分: 3218
  • 用 户 组: 普通用户
  • 注册时间: 2012-02-24 18:21
个人简介

你是不是暗恋我,那就给我发个消息呀,让我知道o(∩∩)o

文章分类

全部博文(433)

分类: PHP

2014-07-18 15:20:43

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 '
阅读(4677) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~