(PECL yar >= 1.0.0)
Yar_Server::handle — 啟動 RPC 伺服器
啟動 RPC HTTP 伺服器,並準備接受 RPC 請求。
注意:
通常 RPC 呼叫會以 HTTP POST 請求發出。如果對 URI 發出 HTTP GET 請求,服務資訊(上述註釋部分)將會印在頁面上。
此函式沒有參數。
布林值
範例 #1 Yar_Server::handle() 範例
<?php
class API {
/**
* 文件資訊會自動產生到服務資訊頁面。
* @params
* @return
*/
public function some_method($parameter, $option = "foo") {
}
protected function client_can_not_see() {
}
}
$service = new Yar_Server(new API());
$service->handle();
?>
以上範例會輸出類似以下的內容