PHP Класс Prado\Util\TRpcClient

Note: When using setIsNotification(true), *every* following request is also considered to be a notification until you use setIsNotification(false). Usage: First, you can use the factory:
$_rpcClient = TRpcClient::create('xml', 'http://host/server');
$_result = $_rpcClient->remoteMethodName($param, $otherParam);
or as oneliner:
$_result = TRpcClient::create('json', 'http://host/server')->remoteMethod($param, ...);
Second, you can also use the specific implementation directly:
$_rpcClient = new TXmlRpcClient('http://host/server');
$_result = $_rpcClient->remoteMethod($param, ...);
or as oneliner:
$_result = TXmlRpcClient('http://host/server')->hello();
С версии: 3.2
Автор: Robin J. Rogge ([email protected])
Наследование: extends Prado\TApplicationComponent
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( $serverUrl, $isNotification = false )
create ( $type, $serverUrl, $isNotification = false ) : TRpcClient Creates an instance of the requested RPC client type
getIsNotification ( ) : boolean
getServerUrl ( ) : string
setIsNotification ( $bool )
setServerUrl ( $value )

Защищенные методы

Метод Описание
createStreamContext ( mixed $content, string $contentType ) Creates a stream context resource
performRequest ( $serverUrl, $payload, $mimeType ) Performs the actual request

Описание методов

__construct() публичный Метод

public __construct ( $serverUrl, $isNotification = false )

create() публичный статический Метод

Creates an instance of the requested RPC client type
public static create ( $type, $serverUrl, $isNotification = false ) : TRpcClient
Результат TRpcClient instance

createStreamContext() защищенный Метод

Creates a stream context resource
protected createStreamContext ( mixed $content, string $contentType )
$content mixed
$contentType string mime type

getIsNotification() публичный Метод

public getIsNotification ( ) : boolean
Результат boolean whether requests are considered to be notifications (completely ignoring the response)

getServerUrl() публичный Метод

public getServerUrl ( ) : string
Результат string url of the RPC server

performRequest() защищенный Метод

Performs the actual request
protected performRequest ( $serverUrl, $payload, $mimeType )

setIsNotification() публичный Метод

public setIsNotification ( $bool )

setServerUrl() публичный Метод

public setServerUrl ( $value )