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
파일 보기 프로젝트 열기: pradosoft/prado

공개 메소드들

메소드 설명
__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 )