Property | Type | Description | |
---|---|---|---|
$_backend | The backend driver | ||
$_changes | array | (Will remain null until getChanges() is called) | |
$_collection | array | Keys include: - class: The collection class Contacts, Calendar etc... - synckey: The current synckey - newsynckey: The new synckey sent back to the client - id: Server folder id - filtertype: Filter - conflict: Conflicts - truncation: Truncation | |
$_deviceInfo | Horde_ActiveSync_Device | Device object. | |
$_folder | Caches the current state(s) in memory | ||
$_folderUidMap | array | A map of backend folderids to UIDs | |
$_lastSyncStamp | timestamp | The timestamp for the last syncKey | |
$_logger | Horde_Log_Logger | Logger instance | |
$_params | array | Configuration parameters | |
$_procid | integer | The process id (used for logging). | |
$_syncKey | string | The syncKey for the current request. | |
$_thisSyncStamp | timestamp | The current sync timestamp | |
$_type | string | The type of request we are handling. |
Method | Description | |
---|---|---|
RowCmp ( $a, $b ) : unknown_type | Helper function for the _diff method | |
__construct ( array $params = [] ) | Const'r | |
checkCollision ( string $syncKey ) : boolean | Check for the (rare) possibility of a synckey collision between collections. | |
connect ( ) | (Re)open backend storage connection. | |
deleteSyncCache ( string $devid, string $user ) | Delete a complete sync cache | |
deviceExists ( string $devId, string $user = null ) : boolean | Check that a given device id is known to the server. This is regardless of Provisioning status. | |
disconnect ( ) | Close the underlying backend storage connection. | |
generatePolicyKey ( ) : integer | Generate a random 10 digit policy key | |
getChangeCount ( ) : integer | Get the number of server changes. | |
getChanges ( array $options = [] ) : array | Get all items that have changed since the last sync time | |
getCurrentSyncKey ( ) : string | Get the current synckey | |
getDeviceRWStatus ( string $devId, boolean $refresh = false ) : integer | Return a device wipe status | |
getFolderUidForBackendId ( string $serverid ) : string | boolean | Get a EAS Folder Uid for the given backend server id. | |
getFolderUidToBackendIdMap ( ) : array | Return the mapping of folder uids to backend folderids. | |
getKnownFolders ( ) : array | Return an array of known folders. This is essentially the state for a FOLDERSYNC request. AS uses a seperate synckey for FOLDERSYNC requests also, so need to treat it as any other collection. | |
getLastSyncTimestamp ( ) : integer | Get the last time the currently loaded device issued a SYNC request. | |
getLatestSynckeyForCollection ( string $collection_id ) : string | integer | Return the most recently seen synckey for the given collection. | |
getNewSyncKey ( string $syncKey ) : string | Gets the new sync key for a specified sync key. You must save the new sync state under this sync key when done sync'ing by calling setNewSyncKey(), then save(). | |
getNewSyncKeyWrapper ( string $syncKey ) : string | Non-static wrapper for getNewSyncKey. | |
getPolicyKey ( string $devId ) : integer | Obtain the current policy key, if it exists. | |
getSyncCache ( string $devid, string $user, array $fields = null ) : array | Return the sync cache. | |
getSyncKeyCounter ( string $syncKey ) : mixed | Return the counter for the specified syncKey. | |
getSyncKeyUid ( string $syncKey ) : string | Return the UID portion of a synckey. | |
isConflict ( array $stat, string $type ) : boolean | Determines if the server version of the message represented by $stat conflicts with the client version of the message. For this driver, this is true whenever $lastSyncTime is older then $stat['mod']. Method is only called from the Importer during an import of a non-new change from the client. | |
isDuplicatePIMAddition ( string $id ) : string | Check and see that we didn't already see the incoming change from the client. | |
listDevices ( ) : array | List all devices that we know about. | |
loadDeviceInfo ( $device, string $user = null, array $params = [] ) : Horde_ActiveSync_Device | Obtain the device object. | |
loadState ( array $collection, string $syncKey, string $type = null, string $id = null ) | Load and initialize the sync state | |
removeState ( array $options ) | Explicitly remove a state from storage. | |
resetAllPolicyKeys ( ) | Reset ALL device policy keys. Used when server policies have changed and you want to force ALL devices to pick up the changes. This will cause all devices that support provisioning to be reprovisioned. | |
save ( ) | Save the current syncstate to storage | |
saveSyncCache ( array $cache, string $devid, string $user, array $dirty = [] ) | Save the provided sync_cache. | |
setBackend ( Horde_ActiveSync_Driver_Base $backend ) : void | Set the backend driver (should really only be called by a backend object when passing this object to client code) | |
setDeviceInfo ( Horde_ActiveSync_Device $data, array $dirty = [] ) | Set new device info | |
setDeviceProperties ( array $data, string $deviceId ) | Set the device's properties as sent by a SETTINGS request. | |
setDeviceRWStatus ( string $devId, string $status ) | Set a new remotewipe status for the device | |
setLogger ( Horde_Log_Logger $logger ) | Set the logger instance for this object. | |
setNewSyncKey ( string $newKey ) | Update the $oldKey syncState to $newKey. | |
setPolicyKey ( string $devId, integer $key ) | Save a new device policy key to storage. | |
updateState ( string $type, array $change, integer $origin = Horde_ActiveSync::CHANGE_ORIGIN_NA, string $user = null, string $clientid = '' ) | Update the state to reflect changes | |
updateSyncStamp ( ) | Update the syncStamp in the collection state, outside of any other changes. |
Method | Description | |
---|---|---|
_getCutOffDate ( integer $restrict ) : integer | Returns the timestamp of the earliest modification time to consider | |
_getDiff ( array $old, array $new ) : unknown_type | Helper function that performs the actual diff between client state and server state FOLDERSYNC arrays. | |
_getFolderChanges ( ) | Get folder changes. Populates $this->_changes with an array of change entries each containing 'type', 'id' and possibly 'flags'. | |
_getMailMapChanges ( array $changes ) : array | Return all available mailMap changes for the current folder. | |
_havePIMChanges ( ) : boolean | Check for the existence of ANY entries in the map table for this device and user. | |
_loadState ( ) | Load the state represented by $syncKey from storage. |
public static RowCmp ( $a, $b ) : unknown_type | ||
$a | ||
$b | ||
return | unknown_type |
public __construct ( array $params = [] ) | ||
$params | array | All configuration parameters. |
protected static _getCutOffDate ( integer $restrict ) : integer | ||
$restrict | integer | The time period to restrict to |
return | integer |
protected _getFolderChanges ( ) |
protected _getMailMapChanges ( array $changes ) : array | ||
$changes | array | The chagnes array |
return | array | An array of hashes, each in the form of {uid} => array( Horde_ActiveSync::CHANGE_TYPE_FLAGS => true|false, Horde_ActiveSync::CHANGE_TYPE_DELETE => true|false ) |
protected _havePIMChanges ( ) : boolean | ||
return | boolean |
protected _loadState ( ) |
public checkCollision ( string $syncKey ) : boolean | ||
$syncKey | string | The synckey to check. |
return | boolean | True if there was a collision. |
abstract public deleteSyncCache ( string $devid, string $user ) | ||
$devid | string | The device id |
$user | string | The user name. |
abstract public disconnect ( ) |
public generatePolicyKey ( ) : integer | ||
return | integer |
public getChangeCount ( ) : integer | ||
return | integer |
public getChanges ( array $options = [] ) : array | ||
$options | array | An options array: - ping: (boolean) Only detect if there is a change, do not build any messages. DEFAULT: false (Build full change array). |
return | array | An array of hashes describing each change: - id: The id of the item being changed. - type: The type of change. a Horde_ActiveSync::CHANGE_TYPE_* constant. - flags: Used to transport email message flags when type is Horde_ActiveSync::CHANGE_TYPE_FLAGS or set to Horde_ActiveSync::FLAG_NEWMESSAGE when type is Horde_ActiveSync::CHANGE_TYPE_CHANGE and the message represents a new message, as opposed to a change in an existing message. - ignore: Set to true when the change should be ignored, and not sent to the client by the exporter. Usually due to the change being the result of a client originated change. |
public getCurrentSyncKey ( ) : string | ||
return | string | The synkey we last retrieved state for |
public getFolderUidToBackendIdMap ( ) : array | ||
return | array | An array of backend folderids -> uids. |
public getKnownFolders ( ) : array | ||
return | array | An array of folder uids. |
abstract public getLastSyncTimestamp ( ) : integer | ||
return | integer | The timestamp of the last sync, regardless of collection |
public static getNewSyncKey ( string $syncKey ) : string | ||
$syncKey | string | The old syncKey |
return | string | The new synckey |
public getNewSyncKeyWrapper ( string $syncKey ) : string | ||
$syncKey | string | The old syncKey |
return | string | The new synckey |
public getPolicyKey ( string $devId ) : integer | ||
$devId | string | The device id to obtain policy key for. |
return | integer | The current policy key for this device, or 0 if none exists. |
abstract public getSyncCache ( string $devid, string $user, array $fields = null ) : array | ||
$devid | string | The device id. |
$user | string | The user id. |
$fields | array | An array of fields to return. Default is to return the full cache. @since 2.9.0 |
return | array | The current sync cache for the user/device combination. |
public static getSyncKeyCounter ( string $syncKey ) : mixed | ||
$syncKey | string | The synckey to obtain the counter for. |
return | mixed | integer|boolean The increment counter or false if failed. |
public static getSyncKeyUid ( string $syncKey ) : string | ||
$syncKey | string | The synckey |
return | string | The UID. |
abstract public isDuplicatePIMAddition ( string $id ) : string | ||
$id | string | The client id sent during message addition. |
return | string | The UID for the given clientid, null if none found. |
abstract public listDevices ( ) : array | ||
return | array | An array of device hashes |
abstract public loadDeviceInfo ( $device, string $user = null, array $params = [] ) : Horde_ActiveSync_Device | ||
$user | string | |
$params | array | Additional parameters: - force: (boolean) If true, reload the device info even if it's already loaded. Used to refresh values such as device_rwstatus that may have changed during a long running PING/SYNC. DEFAULT: false. @since 2.31.0 |
return | Horde_ActiveSync_Device |
public loadState ( array $collection, string $syncKey, string $type = null, string $id = null ) | ||
$collection | array | The collection array for the collection, if a FOLDERSYNC, pass an empty array. |
$syncKey | string | The synckey of the state to load. If empty will force a reset of the state for the class specified in $id |
$type | string | The type of state a Horde_ActiveSync::REQUEST_TYPE constant. |
$id | string | The folder id this state represents. If empty assumed to be a foldersync state. |
abstract public removeState ( array $options ) | ||
$options | array | An options array containing: - synckey: (string) Remove only the state associated with this synckey. - devId: (string) Remove all information for this device. - user: (string) When removing device info, restrict to removing data for this user only. - id: (string) When removing device state, restrict ro removing data only for this collection. |
abstract public resetAllPolicyKeys ( ) |
public setBackend ( Horde_ActiveSync_Driver_Base $backend ) : void | ||
$backend | Horde_ActiveSync_Driver_Base | The backend driver |
return | void |
abstract public setDeviceInfo ( Horde_ActiveSync_Device $data, array $dirty = [] ) | ||
$data | Horde_ActiveSync_Device | The device information |
$dirty | array | Array of dirty properties. @since 2.9.0 |
abstract public setDeviceProperties ( array $data, string $deviceId ) | ||
$data | array | The device settings |
$deviceId | string | The device id. |
abstract public setDeviceRWStatus ( string $devId, string $status ) | ||
$devId | string | The device id. |
$status | string | A Horde_ActiveSync::RWSTATUS_* constant. |
public setLogger ( Horde_Log_Logger $logger ) | ||
$logger | Horde_Log_Logger |
public setNewSyncKey ( string $newKey ) | ||
$newKey | string |
abstract public setPolicyKey ( string $devId, integer $key ) | ||
$devId | string | The device id |
$key | integer | The new policy key |
abstract public updateState ( string $type, array $change, integer $origin = Horde_ActiveSync::CHANGE_ORIGIN_NA, string $user = null, string $clientid = '' ) | ||
$type | string | The type of change (change, delete, flags or foldersync) |
$change | array | A stat/change hash describing the change. Contains: - id: The message uid the change applies to - parent: The parent of the message, normally the folder id. - flags: If this is a flag change, the state of the read flag. - mod: The modtime of this change for collections that use it. |
$origin | integer | Flag to indicate the origin of the change: Horde_ActiveSync::CHANGE_ORIGIN_NA - Not applicapble/not important Horde_ActiveSync::CHANGE_ORIGIN_PIM - Change originated from client |
$user | string | The current sync user, only needed if change origin is CHANGE_ORIGIN_PIM |
$clientid | string | client clientid sent when adding a new message |
public updateSyncStamp ( ) |
protected array $_changes | ||
return | array |
protected array $_collection | ||
return | array |
protected Horde_ActiveSync_Device $_deviceInfo | ||
return | Horde_ActiveSync_Device |
protected array $_folderUidMap | ||
return | array |
protected timestamp $_lastSyncStamp | ||
return | timestamp |
protected Horde_Log_Logger $_logger | ||
return | Horde_Log_Logger |
protected int $_procid | ||
return | integer |
protected string $_syncKey | ||
return | string |
protected timestamp $_thisSyncStamp | ||
return | timestamp |
protected string $_type | ||
return | string |