PHP Класс Horde_Rpc, horde

TODO: - Introspection documentation and method signatures. EXAMPLE: $response = Horde_Rpc::request('xmlrpc', 'http://localhost:80/horde/rpc.php', 'contacts.search', $transport_client, array(array('jan'), array('localsql'), array('name', 'email')));
Автор: Jan Schneider ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_logger Horde_Log_Logger Logging
$_params array All driver-specific parameters.
$_request Horde_Controller_Request_Http ..
$_requestMissingAuthorization boolean Whether we should exit if auth fails instead of requesting authorization credentials.
$_requireAuthorization boolean Do we need an authenticated user?

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

Метод Описание
__construct ( Horde_Controller_Request_Http $request, array $params = [] ) Constructor.
authorize ( ) : boolean Check authentication. Different backends may handle authentication in different ways. The base class implementation checks for HTTP Authentication against the Horde auth setup.
factory ( mixed $driver, $request, array $params = null ) : Horde_Rpc Attempts to return a concrete RPC server instance based on $driver.
getInput ( ) : mixed Get the request body input. Different RPC backends can override this to return an open stream to php://stdin, for instance - whatever is easiest to handle in the getResponse() method.
getResponse ( $request ) : string Sends an RPC request to the server implementation and returns the result.
getResponseContentType ( ) : string Returns the Content-Type of the response.
request ( string $driver, string | Horde_Url $url, string $method, mixed $client, array $params = null ) : mixed Builds an RPC request and sends it to the RPC server.
sendOutput ( string $output ) : void Send the output back to the client

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

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

Constructor.
public __construct ( Horde_Controller_Request_Http $request, array $params = [] )
$request Horde_Controller_Request_Http The request object.
$params array A hash containing any additional configuration or connection parameters a subclass might need.

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

Check authentication. Different backends may handle authentication in different ways. The base class implementation checks for HTTP Authentication against the Horde auth setup.
public authorize ( ) : boolean
Результат boolean Returns true if authentication is successful. Should send appropriate "not authorized" headers or other response codes/body if auth fails, and take care of exiting.

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

Attempts to return a concrete RPC server instance based on $driver.
public static factory ( mixed $driver, $request, array $params = null ) : Horde_Rpc
$driver mixed The type of concrete Horde_Rpc subclass to return.
$params array A hash containing any additional configuration or connection parameters a subclass might need.
Результат Horde_Rpc The newly created concrete Horde_Rpc server instance, or an exception if there is an error.

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

The base class implementation looks for $HTTP_RAW_POST_DATA and returns that if it's available; otherwise, it returns the contents of php://stdin.
public getInput ( ) : mixed
Результат mixed The input - a string (default), a filehandle, etc.

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

Sends an RPC request to the server implementation and returns the result.
public getResponse ( $request ) : string
Результат string The 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 RPC client.
public static request ( string $driver, string | Horde_Url $url, string $method, mixed $client, array $params = null ) : mixed
$driver string The protocol driver to use. Currently 'soap', 'xmlrpc' and 'jsonrpc' are available.
$url string | Horde_Url The path to the RPC server on the called host.
$method string The method to call.
$client mixed An appropriate request client for the type of request. (Horde_Http_Request, SoapClient etc..)
$params array A hash containing any necessary parameters for the method call.
Результат mixed The returned result from the method

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

Send the output back to the client
public sendOutput ( string $output ) : void
$output string The output to send back to the client. Can be overridden in classes if needed.
Результат void

Описание свойств

$_logger защищенное свойство

Logging
protected Horde_Log_Logger $_logger
Результат Horde_Log_Logger

$_params защищенное свойство

All driver-specific parameters.
protected array $_params
Результат array

$_request защищенное свойство

..
protected Horde_Controller_Request_Http $_request
Результат Horde_Controller_Request_Http

$_requestMissingAuthorization защищенное свойство

Whether we should exit if auth fails instead of requesting authorization credentials.
protected bool $_requestMissingAuthorization
Результат boolean

$_requireAuthorization защищенное свойство

Do we need an authenticated user?
protected bool $_requireAuthorization
Результат boolean