PHP 클래스 Prado\Web\Services\TRpcProtocol

TRpcProtocol is the base class used to implement a protocol in a {@link TRpcService}. Prado already implements two protocols: {@link TXmlRpcProtocol} for Xml-Rpc request and {@link TJsonRpcProtocol} for JSON-Rpc requests.
부터: 3.2
저자: Robin J. Rogge ([email protected])
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$rpcMethods containing the mapping from RPC method names to the actual handlers

공개 메소드들

메소드 설명
addMethod ( string $methodName, array $handlerDetails ) Registers a new RPC method and handler details
callApiMethod ( string $methodName, array $parameters ) : mixed Calls the callback handler for the given method
callMethod ( $requestPayload ) : processed
createErrorResponse ( TRpcException $exception ) : a
createResponseHeaders ( $response )
decode ( $data ) : mixed Decodes the request payload
encode ( $data ) : string Encodes the response

메소드 상세

addMethod() 공개 메소드

Registers a new RPC method and handler details
public addMethod ( string $methodName, array $handlerDetails )
$methodName string
$handlerDetails array containing the callback handler

callApiMethod() 공개 메소드

Calls the callback handler for the given method
public callApiMethod ( string $methodName, array $parameters ) : mixed
$methodName string of the RPC
$parameters array for the callback handler as provided by the client
리턴 mixed whatever the callback handler returns

callMethod() 추상적인 공개 메소드

abstract public callMethod ( $requestPayload ) : processed
리턴 processed response

createErrorResponse() 추상적인 공개 메소드

abstract public createErrorResponse ( TRpcException $exception ) : a
$exception TRpcException
리턴 a response representing the error

createResponseHeaders() 추상적인 공개 메소드

abstract public createResponseHeaders ( $response )

decode() 추상적인 공개 메소드

Decodes the request payload
abstract public decode ( $data ) : mixed
리턴 mixed decoded request

encode() 추상적인 공개 메소드

Encodes the response
abstract public encode ( $data ) : string
리턴 string encoded response

프로퍼티 상세

$rpcMethods 보호되어 있는 프로퍼티

containing the mapping from RPC method names to the actual handlers
protected $rpcMethods