2024 年日本 PHP 研討會

Yar_Client 類別

(沒有版本資訊,可能只在 Git 中)

簡介

類別概要

類別 Yar_Client {
/* 屬性 */
保護的 $_protocol;
保護的 $_uri;
保護的 $_options;
保護的 $_running;
/* 方法 */
公開的 __call(字串 $method, 陣列 $parameters):
最終 公開的 __construct(字串 $url, 陣列 $options = ?)
公開的 setOpt(整數 $name, 混合 $value): Yar_Client|false
}

屬性

_protocol

_uri

_options

_running

目錄

新增註釋

使用者貢獻的註釋 1 則註釋

porschegt23 at foxmail dot com
8 年前
這裡有一個簡單的例子

server.php
<?php
類別 API {

公開 函式
api($parameter = "", $option = "foo") {
返回
$this->client_can_not_see($parameter);
}


公開 函式
doAdd($a = 0, $b = 0) {
返回
$a+$b;
}

保護 函式
client_can_not_see( $name ) {
返回
"你好$name~";
}
}

$service = new Yar_Server ( new API () );
$service->handle ();
?>
client.php
<?php
$client
= new Yar_Client("http://host/server.php");
$result = $client->api("parameter");
顯示
$result.'<hr>';
顯示
$client->doAdd(10, 20);
?>
To Top