PHP Class Horde_ActiveSync, horde

Author: Michael J Rubinsky ([email protected])
Mostrar archivo Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_certPath string Path to root certificate bundle
$_collectionsObj Horde_ActiveSync_Collections The singleton collections handler.
$_compression boolean Support gzip compression of certain data parts?
$_decoder Horde_ActiveSync_Wbxml_Decoder Wbxml decoder
$_device Horde_ActiveSync_Device
$_encoder Horde_ActiveSync_Wbxml_Encoder Wbxml encoder
$_get array Local cache of Get variables/decoded base64 uri
$_globalError boolean Global error flag.
$_logger Horde_Log_Logger The logger for this class.
$_loggerFactory Horde_ActiveSync_Interface_LoggerFactory Logger
$_maxVersion float Highest version to support.
$_multipart boolean Multipart support?
$_needMsRp boolean Flag to indicate we need to update the device version.
$_procid integer Process id (used in logging).
$_provisioning string Provisioning support
$_supportedVersions array Supported EAS versions.
$_version float The actual version we are supporting.

Public Methods

Method Description
__construct ( Horde_ActiveSync_Driver_Base $driver, Horde_ActiveSync_Wbxml_Decoder $decoder, Horde_ActiveSync_Wbxml_Encoder $encoder, Horde_ActiveSync_State_Base $state, Horde_Controller_Request_Http $request ) : Horde_ActiveSync Const'r
__get ( string $property ) : mixed Getter
activeSyncHeader ( ) Send the MS_Server-ActiveSync header.
authenticate ( Horde_ActiveSync_Credentials $credentials ) : boolean Authenticate to the backend.
checkGlobalError ( ) : mixed Return any global errors that occured during initial connection.
commandsHeader ( ) Send protocol commands header.
contentTypeHeader ( $content_type = null ) Send the content type header.
getCollectionsObject ( ) : Horde_ActiveSync_Collections Return a collections singleton.
getGetVars ( ) : array Return the GET variables passed from the device, decoding from base64 if needed.
getImporter ( ) : Horde_ActiveSync_Connector_Importer Return an Importer object.
getMIMETruncSize ( integer $truncation ) : integer | boolean Return the number of bytes corresponding to the requested trunction constant. This applies to MIMETRUNCATION only.
getPolicyKey ( ) : integer Obtain the policy key header from the request.
getProtocolVersion ( ) : string Obtain the ActiveSync protocol version requested by the client headers.
getSupportedCommands ( ) : string Return the supported commands in a comma delimited string suitable for sending as the MS-ASProtocolCommands header.
getSupportedVersions ( ) : string Return supported versions in a comma delimited string suitable for sending as the MS-ASProtocolVersions header.
getSyncCache ( ) : Horde_ActiveSync_SyncCache Return a new, fully configured SyncCache.
getTruncSize ( integer $truncation ) : integer | boolean Return the number of bytes corresponding to the requested trunction constant.
handleRequest ( string $cmd, string $devId ) : string | boolean The heart of the server. Dispatch a request to the appropriate request handler.
messageFactory ( string $message ) : Horde_ActiveSync_Message_Base Factory method for creating Horde_ActiveSync_Message objects.
provisionHeader ( ) Send provision header
provisioningRequired ( ) Send the headers indicating that provisioning is required.
setLogger ( Horde_ActiveSync_Interface_LoggerFactory $logger ) : void Setter for the logger
setProvisioning ( $provision ) Setter for provisioning support
setRootCertificatePath ( string $path ) Set the local path to the root certificate bundle.
setSupportedVersion ( float $version ) Allow to force the highest version to support.
versionHeader ( ) Send the protocol versions header.

Protected Methods

Method Description
_doOptionsRequest ( ) Send the OPTIONS request response headers.
_handleDevice ( string $devId ) : boolean Handle device checks. Takes into account permissions and restrictions via various callback methods.
_setLogger ( array $options )

Method Details

__construct() public method

Const'r
public __construct ( Horde_ActiveSync_Driver_Base $driver, Horde_ActiveSync_Wbxml_Decoder $decoder, Horde_ActiveSync_Wbxml_Encoder $encoder, Horde_ActiveSync_State_Base $state, Horde_Controller_Request_Http $request ) : Horde_ActiveSync
$driver Horde_ActiveSync_Driver_Base The backend driver.
$decoder Horde_ActiveSync_Wbxml_Decoder The Wbxml decoder.
$encoder Horde_ActiveSync_Wbxml_Encoder The Wbxml encoder.
$state Horde_ActiveSync_State_Base The state driver.
$request Horde_Controller_Request_Http The HTTP request object.
return Horde_ActiveSync The ActiveSync server object.

__get() public method

Getter
public __get ( string $property ) : mixed
$property string The property to return.
return mixed The value of the requested property.

_doOptionsRequest() protected method

Send the OPTIONS request response headers.
protected _doOptionsRequest ( )

_handleDevice() protected method

Handle device checks. Takes into account permissions and restrictions via various callback methods.
protected _handleDevice ( string $devId ) : boolean
$devId string The client provided device id.
return boolean If EAS version is > 12.1 returns false on any type of failure in allowing the device to connect. Sets appropriate internal variables to indicate the type of error to return to the client. Failure on EAS version < 12.1 results in throwing exceptions. Otherwise, return true.

_setLogger() protected method

protected _setLogger ( array $options )
$options array

activeSyncHeader() public method

Send the MS_Server-ActiveSync header.
public activeSyncHeader ( )

authenticate() public method

Authenticate to the backend.
public authenticate ( Horde_ActiveSync_Credentials $credentials ) : boolean
$credentials Horde_ActiveSync_Credentials The credentials object.
return boolean True on successful authentication to the backend.

checkGlobalError() public method

Return any global errors that occured during initial connection.
Since: 2.4.0
public checkGlobalError ( ) : mixed
return mixed A Horde_ActiveSync_Status:: constant of boolean false if no errors.

commandsHeader() public method

Send protocol commands header.
public commandsHeader ( )

contentTypeHeader() public method

Send the content type header.
public contentTypeHeader ( $content_type = null )

getCollectionsObject() public method

Return a collections singleton.
Since: 2.4.0
public getCollectionsObject ( ) : Horde_ActiveSync_Collections
return Horde_ActiveSync_Collections

getGetVars() public method

Return the GET variables passed from the device, decoding from base64 if needed.
public getGetVars ( ) : array
return array A hash of get variables => values.

getImporter() public method

Return an Importer object.
Since: 2.4.0
public getImporter ( ) : Horde_ActiveSync_Connector_Importer
return Horde_ActiveSync_Connector_Importer

getMIMETruncSize() public static method

Return the number of bytes corresponding to the requested trunction constant. This applies to MIMETRUNCATION only.
Since: 2.20.0
public static getMIMETruncSize ( integer $truncation ) : integer | boolean
$truncation integer The constant.
return integer | boolean Either the size, in bytes, to truncate or falso if no truncation.

getPolicyKey() public method

Obtain the policy key header from the request.
public getPolicyKey ( ) : integer
return integer The policy key or '0' if not set.

getProtocolVersion() public method

Obtain the ActiveSync protocol version requested by the client headers.
public getProtocolVersion ( ) : string
return string The EAS version requested by the client.

getSupportedCommands() public method

Return the supported commands in a comma delimited string suitable for sending as the MS-ASProtocolCommands header.
public getSupportedCommands ( ) : string
return string

getSupportedVersions() public method

Return supported versions in a comma delimited string suitable for sending as the MS-ASProtocolVersions header.
public getSupportedVersions ( ) : string
return string

getSyncCache() public method

Return a new, fully configured SyncCache.
Since: 2.4.0
public getSyncCache ( ) : Horde_ActiveSync_SyncCache
return Horde_ActiveSync_SyncCache

getTruncSize() public method

Return the number of bytes corresponding to the requested trunction constant.
public getTruncSize ( integer $truncation ) : integer | boolean
$truncation integer The constant.
return integer | boolean Either the size, in bytes, to truncate or falso if no truncation.

handleRequest() public method

The heart of the server. Dispatch a request to the appropriate request handler.
public handleRequest ( string $cmd, string $devId ) : string | boolean
$cmd string The command we are requesting.
$devId string The device id making the request. @deprecated
return string | boolean false if failed, true if succeeded and response content is wbxml, otherwise the content-type string to send in the response.

messageFactory() public static method

Factory method for creating Horde_ActiveSync_Message objects.
Since: 2.4.0
public static messageFactory ( string $message ) : Horde_ActiveSync_Message_Base
$message string The message type.
return Horde_ActiveSync_Message_Base The concrete message object.

provisionHeader() public method

Send provision header
public provisionHeader ( )

provisioningRequired() public method

Send the headers indicating that provisioning is required.

setLogger() public method

Setter for the logger
public setLogger ( Horde_ActiveSync_Interface_LoggerFactory $logger ) : void
$logger Horde_ActiveSync_Interface_LoggerFactory The logger object.
return void

setProvisioning() public method

Setter for provisioning support
public setProvisioning ( $provision )

setRootCertificatePath() public method

Set the local path to the root certificate bundle.
public setRootCertificatePath ( string $path )
$path string The local path to the bundle.

setSupportedVersion() public method

Allow to force the highest version to support.
public setSupportedVersion ( float $version )
$version float The highest version

versionHeader() public method

Send the protocol versions header.
public versionHeader ( )

Property Details

$_certPath protected_oe property

Path to root certificate bundle
protected string $_certPath
return string

$_collectionsObj protected_oe property

The singleton collections handler.
protected Horde_ActiveSync_Collections $_collectionsObj
return Horde_ActiveSync_Collections

$_compression protected_oe property

Support gzip compression of certain data parts?
protected bool $_compression
return boolean

$_decoder protected_oe property

Wbxml decoder
protected Horde_ActiveSync_Wbxml_Decoder $_decoder
return Horde_ActiveSync_Wbxml_Decoder

$_device protected_oe static_oe property

protected static Horde_ActiveSync_Device $_device
return Horde_ActiveSync_Device

$_encoder protected_oe property

Wbxml encoder
protected Horde_ActiveSync_Wbxml_Encoder $_encoder
return Horde_ActiveSync_Wbxml_Encoder

$_get protected_oe property

Local cache of Get variables/decoded base64 uri
protected array $_get
return array

$_globalError protected_oe property

Global error flag.
protected bool $_globalError
return boolean

$_logger protected_oe static_oe property

The logger for this class.
protected static Horde_Log_Logger $_logger
return Horde_Log_Logger

$_loggerFactory protected_oe property

Logger
protected Horde_ActiveSync_Interface_LoggerFactory $_loggerFactory
return Horde_ActiveSync_Interface_LoggerFactory

$_maxVersion protected_oe property

Highest version to support.
protected float $_maxVersion
return float

$_multipart protected_oe property

Multipart support?
protected bool $_multipart
return boolean

$_needMsRp protected_oe property

Flag to indicate we need to update the device version.
protected bool $_needMsRp
return boolean

$_procid protected_oe property

Process id (used in logging).
protected int $_procid
return integer

$_provisioning protected_oe property

Provisioning support
protected string $_provisioning
return string

$_supportedVersions protected_oe static_oe property

Supported EAS versions.
protected static array $_supportedVersions
return array

$_version protected_oe static_oe property

The actual version we are supporting.
protected static float $_version
return float