\Horde_Rpc_ActiveSync

Copyright 2009-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Summary

Methods
Properties
Constants
__construct()
authorize()
getInput()
getResponse()
getResponseContentType()
sendOutput()
request()
factory()
No public properties found
No constants found
_handleError()
_sendAuthenticationFailedHeaders()
$_params
$_requireAuthorization
$_requestMissingAuthorization
$_request
$_logger
$_get
$_server
$_contentType
N/A
No private methods found
No private properties found
N/A

Properties

$_params

$_params : array

All driver-specific parameters.

Type

array

$_requireAuthorization

$_requireAuthorization : boolean

Do we need an authenticated user?

Type

boolean

$_requestMissingAuthorization

$_requestMissingAuthorization : boolean

Whether we should exit if auth fails instead of requesting authorization credentials.

Type

boolean

$_request

$_request : \Horde_Controller_Request_Http

Request variables, cookies etc.

..

Type

\Horde_Controller_Request_Http

$_logger

$_logger : \Horde_Log_Logger

Logging

Type

\Horde_Log_Logger

$_get

$_get : array

Holds the request's GET variables

Type

array

$_server

$_server : \Horde_ActiveSync

The ActiveSync server object

Type

\Horde_ActiveSync

$_contentType

$_contentType : string

Content type header to send in response.

Type

string

Methods

__construct()

__construct(\Horde_Controller_Request_Http  $request, array  $params = array()) 

Constructor.

Parameters

\Horde_Controller_Request_Http $request

The request object.

array $params

A hash containing configuration parameters:

  • server: (Horde_ActiveSync) The ActiveSync server object. DEFAULT: none, REQUIRED

authorize()

authorize() : boolean

Override the authorize method and always return true. The ActiveSync server classes handle authentication directly since we need complete control over what responses are sent.

Returns

boolean

getInput()

getInput() : mixed

Horde_ActiveSync will read the input stream directly, do not access it here.

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.

Returns

mixed —

The input - a string (default), a filehandle, etc.

getResponse()

getResponse(string  $request) : string

Sends an RPC request to the server and returns the result.

Parameters

string $request

PHP input stream (ignored).

Returns

string —

The response from the server.

getResponseContentType()

getResponseContentType() : string

Returns the Content-Type of the response.

Returns

string —

The MIME Content-Type of the RPC response.

sendOutput()

sendOutput(string  $output) : void

Send the output back to the client

Parameters

string $output

The output to send back to the client. Can be overridden in classes if needed.

request()

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.

This statically called method is actually the RPC client.

Parameters

string $driver

The protocol driver to use. Currently 'soap', 'xmlrpc' and 'jsonrpc' are available.

string|\Horde_Url $url

The path to the RPC server on the called host.

string $method

The method to call.

mixed $client

An appropriate request client for the type of request. (Horde_Http_Request, SoapClient etc..)

array $params

A hash containing any necessary parameters for the method call.

Throws

\Horde_Rpc_Exception

Returns

mixed —

The returned result from the method

factory()

factory(mixed  $driver,   $request, array  $params = null) : \Horde_Rpc

Attempts to return a concrete RPC server instance based on $driver.

Parameters

mixed $driver

The type of concrete Horde_Rpc subclass to return.

$request
array $params

A hash containing any additional configuration or connection parameters a subclass might need.

Returns

\Horde_Rpc

The newly created concrete Horde_Rpc server instance, or an exception if there is an error.

_handleError()

_handleError(\Exception  $e) 

Output exception information to the logger.

Parameters

\Exception $e

The exception

Throws

\Horde_Rpc_Exception

$e

_sendAuthenticationFailedHeaders()

_sendAuthenticationFailedHeaders(  $e) 

Send 401 Unauthorized headers.

Parameters

$e