PHP Класс Horde_ActiveSync_Driver_Base, horde

Автор: Michael J Rubinsky ([email protected])
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$_authPass string User password
$_authUser string Authenticating user
$_device Horde_ActiveSync_Device The device object
$_logger Horde_Log_Logger Logger instance
$_params array Parameters
$_state Horde_ActiveSync_State_Base The state driver for this request. Needs to be injected into this class.
$_tempMap array Temporary serverid to uid map. Used when creating the hierarchy for the first time
$_typeMap
$_user string The username to sync with the backend as
$_version float Protocol version

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

Метод Описание
__construct ( array $params = [] ) : Horde_ActiveSync_Driver Const'r
__destruct ( ) Prevent circular dependency issues.
addDefaultBodyPrefTruncation ( array $bodyprefs ) : array Add default truncation values for this driver.
authenticate ( string $username, string $password, string $domain = null ) : mixed Any code needed to authenticate to backend as the actual user.
autoDiscover ( ) : array Return properties for an AUTODISCOVER request.
buildFbString ( stdClass $fb, Horde_Date $start, Horde_Date $end ) : string Build a EAS style FB string. Essentially, each digit represents 1/2 hour.
changeFolder ( string $id, string $displayname, string $parent, string $uid = null ) : Horde_ActiveSync_Message_Folder Change a folder on the server.
changeMessage ( string $folderid, string $id, Horde_ActiveSync_Message_Base $message, Horde_ActiveSync_Device $device ) : array | boolean Add/Edit a message
clearAuthentication ( ) : boolean Clear authentication
deleteFolder ( string $id, string $parent = Horde_ActiveSync::FOLDER_ROOT ) Delete a folder on the server.
deleteMessage ( string $folderid, array $ids ) Delete a message
fetch ( string $folderid, string $id, array $collection ) : Horde_ActiveSync_Message_Base Obtain the FULL message from the backend, regardless of any truncation options.
getAttachment ( string $name, array $options = [] ) : array Return the specified attachment.
getCurrentPolicy ( ) : array Return the security policies.
getFolder ( string $id ) : Horde_ActiveSync_Message_Folder Return the ActiveSync message object for the specified folder.
getFolderList ( ) : array Get the list of folder stat arrays @see self::statFolder()
getFolders ( ) : array Return an array of folder objects.
getFreebusy ( string $user, array $options = [] ) : mixed Request freebusy information from the server
getHeartbeatConfig ( ) : array Obtain the ping heartbeat settings
getMessage ( string $folderid, string $id, array $collection ) : Horde_ActiveSync_Message_Base Obtain an ActiveSync message from the backend.
getProvisioning ( ) : mixed Returns the provisioning support for the current request.
getSearchResults ( string $type, array $query ) : array Returns array of items which contain contact information
getServerChanges ( string $folderId, integer $from_ts, integer $to_ts, integer $cutoffdate, boolean $ping ) : array Get a list of server changes that occured during the specified time period.
getSettings ( array $settings, Horde_ActiveSync_Device $device ) : array Return settings from the backend for a SETTINGS request.
getSpecialFolderNameByType ( string $type ) : string Return the server id of the specified special folder type.
getSyncStamp ( $collection ) : integer Return the SyncStamp - the value used to determine the end of the current sync range. Default implementation uses timestamps. Concrete drivers can override this to provide another method to do this, such as using modification sequences.
getUser ( ) : string Get the username for this request.
getUsernameFromEmail ( string $email ) : string Attempt to guess a username based on the email address passed from EAS Autodiscover requests.
getWasteBasket ( string $class ) : string | boolean Get the wastebasket folder.
itemOperationsFetchMailbox ( string $longid, array $bodyprefs, boolean $mimesupport ) : Horde_ActiveSync_Message_Base Returnmail object represented by the specified longid. Used to fetch email objects from a search result, which only returns a 'longid'.
itemOperationsGetAttachmentData ( string $filereference ) Return the specified attachement data for an ITEMOPERATIONS request.
itemOperationsGetDocumentLibraryLink ( string $linkid, array $cred ) : array Return a documentlibrary item.
meetingResponse ( array $response ) : string Hanlde meeting responses.
moveMessage ( string $folderid, array $ids, string $newfolderid ) : array Move message
resolveRecipient ( string $type, string $search, array $options = [] ) : array Handle ResolveRecipient requests
sendMail ( mixed $rfc822, integer $forward = null, integer $reply = null, string $parent = null, boolean $save = true ) : boolean Sends the email represented by the rfc822 string received by the client.
setDevice ( Horde_ActiveSync_Device $device ) Set the currently connected device
setLogger ( Horde_Log_Logger $logger ) Setter for the logger instance
setProtocolVersion ( float $version ) Set the protocol version. Can't do it in constructer since we don't know the version at the time this driver is instantiated.
setReadFlag ( string $folderid, integer $uid, integer $flag ) Set the read (\seen) flag on the specified message.
setSettings ( array $settings, Horde_ActiveSync_Device $device ) : array Set backend settings from a SETTINGS request.
setup ( string $user ) : boolean Setup sync parameters. The user provided here is the user the backend will sync with. This allows you to authenticate as one user, and sync as another, if the backend supports this.
statFolder ( string $id, mixed $parent, mixed $mod = null ) : a Stat folder. Note that since the only thing that can ever change for a folder is the name, we use that as the 'mod' value.
statMailMessage ( string $folderid, integer | array $id ) : array Build a stat structure for an email message.
statMessage ( string $folderId, string $id ) : hash Get a message stat.

Защищенные методы

Метод Описание
_getClassFromType ( integer $type ) : string Convert a TYPE constant into it's associated CLASS constant.
_getFolderUidForBackendId ( string $id, string $type = null, string $old_id = null ) : string Get an activesync uid for the given backend serverid. If we've seen this serverid before, return the previously created uid, otherwise return a new one.

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

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

Const'r
public __construct ( array $params = [] ) : Horde_ActiveSync_Driver
$params array Any configuration parameters or injected objects the concrete driver may need. - logger: (Horde_Log_Logger) The logger. DEFAULT: none (No logging). - state: (Horde_ActiveSync_State_Base) The state driver. DEFAULT: none (REQUIRED).
Результат Horde_ActiveSync_Driver

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

Prevent circular dependency issues.
public __destruct ( )

_getClassFromType() защищенный Метод

Convert a TYPE constant into it's associated CLASS constant.
protected _getClassFromType ( integer $type ) : string
$type integer The TYPE.
Результат string The CLASS

_getFolderUidForBackendId() защищенный Метод

Get an activesync uid for the given backend serverid. If we've seen this serverid before, return the previously created uid, otherwise return a new one.
С версии: 2.4.0
protected _getFolderUidForBackendId ( string $id, string $type = null, string $old_id = null ) : string
$id string The server's current folder name E.g., INBOX
$type string The folder type, a Horde_ActiveSync::FOLDER_TYPE_* constant. If empty, assumes FOLDER_TYPE_USER_MAIL
$old_id string The previous folder name for this folder, if the folder is being renamed. @since 2.15.0 @todo This is tempoarary until 3.0 (H6) when we will have the collection manager take care of ALL of the folder name <-> UID mapping management.
Результат string A unique identifier for the specified backend folder id. The first character indicates the foldertype as such: 'F' - Email 'C' - Contact 'A' - Appointment 'T' - Task 'N' - Note

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

Add default truncation values for this driver.
Устаревший: Will be removed in 3.0. We don't need and indeed shouldn't set default values for truncationsize. Not to mention we were setting the incorrect constant value instead of the byte value.
public addDefaultBodyPrefTruncation ( array $bodyprefs ) : array
$bodyprefs array BODYPREFERENCE data.
Результат array The BODYPREFERENCE data, with default truncationsize values.

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

Any code needed to authenticate to backend as the actual user.
public authenticate ( string $username, string $password, string $domain = null ) : mixed
$username string The username to authenticate as
$password string The password
$domain string The user domain (unused in this driver).
Результат mixed Boolean true on success, boolean false on credential failure or Horde_ActiveSync::AUTH_REASON_* constant on policy failure.

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

Return properties for an AUTODISCOVER request.
abstract public autoDiscover ( ) : array
Результат array An array of properties.

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

The values are as follows: 0 - Free 1 - Tentative 2 - Busy 3 - OOF 4 - No data available. Though currently we only provide a Free/Busy/Unknown differentiation.
С версии: 2.4.0
public static buildFbString ( stdClass $fb, Horde_Date $start, Horde_Date $end ) : string
$fb stdClass The fb information. An object containing: - s: The start of the period covered. - e: The end of the period covered. - b: An array of busy periods.
$start Horde_Date The start of the period requested by the client.
$end Horde_Date The end of the period requested by the client.
Результат string The EAS freebusy string.

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

Change a folder on the server.
abstract public changeFolder ( string $id, string $displayname, string $parent, string $uid = null ) : Horde_ActiveSync_Message_Folder
$id string The server's folder id
$displayname string The new display name.
$parent string The folder's parent, if needed.
$uid string The existing folder uid, if this is an edit. @since 2.9.0 (@todo Look at this for H6. It's here now to save an extra DB lookup for data we already have.)
Результат Horde_ActiveSync_Message_Folder

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

Add/Edit a message
abstract public changeMessage ( string $folderid, string $id, Horde_ActiveSync_Message_Base $message, Horde_ActiveSync_Device $device ) : array | boolean
$folderid string The server id for the folder the message belongs to.
$id string The server's uid for the message if this is a change to an existing message, null if new.
$message Horde_ActiveSync_Message_Base The activesync message
$device Horde_ActiveSync_Device The device information
Результат array | boolean A stat array if successful, otherwise false.

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

Clear authentication
public clearAuthentication ( ) : boolean
Результат boolean

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

Delete a folder on the server.
abstract public deleteFolder ( string $id, string $parent = Horde_ActiveSync::FOLDER_ROOT )
$id string The server's folder id.
$parent string The folder's parent, if needed.

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

Delete a message
abstract public deleteMessage ( string $folderid, array $ids )
$folderid string The folder id containing the messages.
$ids array An array of message ids to delete.

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

Obtain the FULL message from the backend, regardless of any truncation options.
public fetch ( string $folderid, string $id, array $collection ) : Horde_ActiveSync_Message_Base
$folderid string Folder id containing data to fetch.
$id string Server id of data to fetch.
$collection array The collection data.
Результат Horde_ActiveSync_Message_Base The message data

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

Return the specified attachment.
abstract public getAttachment ( string $name, array $options = [] ) : array
$name string The attachment identifier. For this driver, this consists of 'mailbox:uid:mimepart'
$options array Any options requested. Currently supported: - stream: (boolean) Return a stream resource for the mime contents.
Результат array The attachment in the form of an array with the following structure: array('content-type' => {the content-type of the attachement}, 'data' => {the raw attachment data})

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

Return the security policies.
abstract public getCurrentPolicy ( ) : array
Результат array An array of provisionable properties and values.

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

Return the ActiveSync message object for the specified folder.
abstract public getFolder ( string $id ) : Horde_ActiveSync_Message_Folder
$id string The folder's server id.
Результат Horde_ActiveSync_Message_Folder object.

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

Get the list of folder stat arrays @see self::statFolder()
abstract public getFolderList ( ) : array
Результат array An array of folder stat arrays.

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

Return an array of folder objects.
abstract public getFolders ( ) : array
Результат array An array of Horde_ActiveSync_Message_Folder objects.

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

Request freebusy information from the server
Устаревший: Will be removed in 3.0 - this is provided by resolveRecipients
abstract public getFreebusy ( string $user, array $options = [] ) : mixed
$user string The user to request FB information for.
$options array Options.
Результат mixed boolean|array The FB information, if available. Otherwise false.

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

Obtain the ping heartbeat settings
public getHeartbeatConfig ( ) : array
Результат array

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

Obtain an ActiveSync message from the backend.
abstract public getMessage ( string $folderid, string $id, array $collection ) : Horde_ActiveSync_Message_Base
$folderid string The server's folder id this message is from
$id string The server's message id
$collection array The colletion data. May contain things like: - mimesupport: (integer) Indicates if the device has MIME support. DEFAULT: 0 (No MIME support) - truncation: (integer) Non-MIME truncation limit. Anything larger than this amount of bytes will be truncated. DEFAULT: 0 (No truncation) - mimetruncation: (integer) MIME truncation limit. Anything larger than this amount of bytes will be truncated. DEFAULT: 0 (No truncation) - bodyprefs: (array) The bodypref array from the device.
Результат Horde_ActiveSync_Message_Base The message data

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

Returns the provisioning support for the current request.
abstract public getProvisioning ( ) : mixed
Результат mixed The value of the provisiong support flag.

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

Returns array of items which contain contact information
abstract public getSearchResults ( string $type, array $query ) : array
$type string The search type; ['gal'|'mailbox']
$query array The search query. An array containing: - query: (string) The search term. DEFAULT: none, REQUIRED - range: (string) A range limiter. DEFAULT: none (No range used).
Результат array An array containing: - rows: An array of search results - status: The search store status code.

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

Get a list of server changes that occured during the specified time period.
abstract public getServerChanges ( string $folderId, integer $from_ts, integer $to_ts, integer $cutoffdate, boolean $ping ) : array
$folderId string The server id of the collection to check.
$from_ts integer The starting timestamp.
$to_ts integer The ending timestamp.
$cutoffdate integer The earliest date to retrieve back to.
$ping boolean If true, returned changeset may not contain the full changeset, may only contain a single change, designed only to indicate *some* change has taken place. The value should not be used to determine *what* change has taken place.
Результат array A list of messge uids that have chnaged in the specified time period.

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

Return settings from the backend for a SETTINGS request.
abstract public getSettings ( array $settings, Horde_ActiveSync_Device $device ) : array
$settings array An array of settings to return.
$device Horde_ActiveSync_Device The device to obtain settings for.
Результат array The requested settings.

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

Return the server id of the specified special folder type.
abstract public getSpecialFolderNameByType ( string $type ) : string
$type string The self::SPECIAL_* constant.
Результат string The folder's server id.

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

Return the SyncStamp - the value used to determine the end of the current sync range. Default implementation uses timestamps. Concrete drivers can override this to provide another method to do this, such as using modification sequences.
public getSyncStamp ( $collection ) : integer
$collection string The collection id we are currently requesting.
Результат integer The SyncStamp

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

Get the username for this request.
public getUser ( ) : string
Результат string The current username

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

Attempt to guess a username based on the email address passed from EAS Autodiscover requests.
abstract public getUsernameFromEmail ( string $email ) : string
$email string The email address
Результат string The username to use to authenticate to Horde with.

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

Get the wastebasket folder.
abstract public getWasteBasket ( string $class ) : string | boolean
$class string The collection class.
Результат string | boolean Returns name of the trash folder, or false if not using a trash folder.

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

Returnmail object represented by the specified longid. Used to fetch email objects from a search result, which only returns a 'longid'.
abstract public itemOperationsFetchMailbox ( string $longid, array $bodyprefs, boolean $mimesupport ) : Horde_ActiveSync_Message_Base
$longid string The unique search result identifier.
$bodyprefs array The bodypreference array.
$mimesupport boolean Mimesupport flag.
Результат Horde_ActiveSync_Message_Base The message requested.

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

Return the specified attachement data for an ITEMOPERATIONS request.
abstract public itemOperationsGetAttachmentData ( string $filereference )
$filereference string The attachment identifier.

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

Hanlde meeting responses.
abstract public meetingResponse ( array $response ) : string
$response array The response data. Contains: - requestid: The identifier of the meeting request. Used by the server to fetch the original meeting request details. - response: The user's response to the request. One of the response code constants. - folderid: The collection id that contains the meeting request.
Результат string The UID of any created calendar entries, otherwise false.

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

Move message
abstract public moveMessage ( string $folderid, array $ids, string $newfolderid ) : array
$folderid string Existing folder id
$ids array Message UIDs
$newfolderid string The new folder id
Результат array The new uids for the message.

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

Handle ResolveRecipient requests
abstract public resolveRecipient ( string $type, string $search, array $options = [] ) : array
$type string The type of recipient request. e.g., 'certificate'
$search string The email to resolve.
$options array
Результат array An array of results containing any of the following: - type: (string) The type of result a GAL entry or personal address book entry. A Horde_ActiveSync::RESOLVE_RESULT constant. - displayname: (string) The display name of the contact. - emailaddress: (string) The emailaddress. - entries: (array) An array of certificates. - availability: (string) A EAS style FB string. - picture: (Horde_ActiveSync_Message_ResolveRecipientsPicture)

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

Sends the email represented by the rfc822 string received by the client.
abstract public sendMail ( mixed $rfc822, integer $forward = null, integer $reply = null, string $parent = null, boolean $save = true ) : boolean
$rfc822 mixed The rfc822 mime message, a string or stream resource.
$forward integer The UID of the message, if forwarding.
$reply integer The UID of the message if replying.
$parent string The collection id of parent message if forwarding/replying.
$save boolean Save in sent messages.
Результат boolean

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

Set the currently connected device
public setDevice ( Horde_ActiveSync_Device $device )
$device Horde_ActiveSync_Device The device object.

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

Setter for the logger instance
public setLogger ( Horde_Log_Logger $logger )
$logger Horde_Log_Logger The logger

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

Set the protocol version. Can't do it in constructer since we don't know the version at the time this driver is instantiated.
public setProtocolVersion ( float $version )
$version float The EAS protocol version to use.

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

Set the read (\seen) flag on the specified message.
Устаревший: Will be removed in 3.0, use changeMessage() instead.
abstract public setReadFlag ( string $folderid, integer $uid, integer $flag )
$folderid string The folder id containing the message.
$uid integer The message IMAP UID.
$flag integer The value to set the flag to.

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

Set backend settings from a SETTINGS request.
abstract public setSettings ( array $settings, Horde_ActiveSync_Device $device ) : array
$settings array The settings to store.
$device Horde_ActiveSync_Device The device to store settings for.
Результат array An array of status responses for each set request. e.g.,: array('oof' => Horde_ActiveSync_Request_Settings::STATUS_SUCCESS, 'deviceinformation' => Horde_ActiveSync_Request_Settings::STATUS_SUCCESS);

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

Setup sync parameters. The user provided here is the user the backend will sync with. This allows you to authenticate as one user, and sync as another, if the backend supports this.
public setup ( string $user ) : boolean
$user string The username to sync as on the backend.
Результат boolean

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

Stat folder. Note that since the only thing that can ever change for a folder is the name, we use that as the 'mod' value.
abstract public statFolder ( string $id, mixed $parent, mixed $mod = null ) : a
$id string The folder id
$parent mixed The parent folder (or 0 if none).
$mod mixed Modification indicator. For folders, this is the name of the folder, since that's the only thing that can change.
Результат a stat hash

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

Build a stat structure for an email message.
abstract public statMailMessage ( string $folderid, integer | array $id ) : array
$folderid string The mailbox name.
$id integer | array The message(s) to stat (IMAP UIDs).
Результат array

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

Get a message stat.
abstract public statMessage ( string $folderId, string $id ) : hash
$folderId string The folder id
$id string The message id (??)
Результат hash with 'id', 'mod', and 'flags' members

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

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

User password
protected string $_authPass
Результат string

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

Authenticating user
protected string $_authUser
Результат string

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

The device object
С версии: 2.12.0
protected Horde_ActiveSync_Device $_device
Результат Horde_ActiveSync_Device

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

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

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

Parameters
protected array $_params
Результат array

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

The state driver for this request. Needs to be injected into this class.
protected Horde_ActiveSync_State_Base $_state
Результат Horde_ActiveSync_State_Base

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

Temporary serverid to uid map. Used when creating the hierarchy for the first time
protected array $_tempMap
Результат array

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

protected $_typeMap

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

The username to sync with the backend as
protected string $_user
Результат string

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

Protocol version
protected float $_version
Результат float