PHP 클래스 Horde_Rpc_Jsonrpc, horde

- Only POST requests are supported. - Named and positional parameters are accepted but the Horde registry only works with positional parameters. - Service Descriptions are not supported yet.
상속: extends Horde_Rpc
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

공개 메소드들

메소드 설명
_objectsToArrays ( $data ) : mixed Converts stdClass object to associative arrays.
_raiseError ( string | PEAR_Error $error, stdClass $request ) : PEAR_Error Returns a specially crafted PEAR_Error object containing a JSON-RPC response in the error message.
getResponse ( $request ) : string Sends an RPC request to the server and returns the result.
getResponseContentType ( ) : string Returns the Content-Type of the response.
request ( string | Horde_Url $url, string $method, Horde_Http_Client $client, array $params = null ) : mixed Builds an JSON-RPC request and sends it to the server.

메소드 상세

_objectsToArrays() 공개 메소드

Converts stdClass object to associative arrays.
public _objectsToArrays ( $data ) : mixed
$data mixed Any stdClass object, array, or scalar.
리턴 mixed stdClass objects are returned as asscociative arrays, scalars as-is, and arrays with their elements converted.

_raiseError() 공개 메소드

Returns a specially crafted PEAR_Error object containing a JSON-RPC response in the error message.
public _raiseError ( string | PEAR_Error $error, stdClass $request ) : PEAR_Error
$error string | PEAR_Error The error message or object.
$request stdClass The original request object.
리턴 PEAR_Error An error object suitable for a JSON-RPC 1.1 conform error result.

getResponse() 공개 메소드

Sends an RPC request to the server and returns the result.
public getResponse ( $request ) : string
리턴 string The JSON encoded response from the server.

getResponseContentType() 공개 메소드

Returns the Content-Type of the response.
public getResponseContentType ( ) : string
리턴 string The MIME Content-Type of the RPC response.

request() 공개 정적인 메소드

This statically called method is actually the JSON-RPC client.
public static request ( string | Horde_Url $url, string $method, Horde_Http_Client $client, array $params = null ) : mixed
$url string | Horde_Url The path to the JSON-RPC server on the called host.
$method string The method to call.
$client Horde_Http_Client
$params array A hash containing any necessary parameters for the method call.
리턴 mixed The returned result from the method.