Properties

$folders

$folders : array

The folders cache: the list of current folders, keyed by their internal uid and containing 'class', 'serverid' and 'type'.

Type

array

$hbinterval

$hbinterval : integer

The heartbeat interval (in seconds).

Type

integer

$wait

$wait : integer

The wait interval (in minutes).

Type

integer

$pingheartbeat

$pingheartbeat : integer

The heartbeat used in PING requests.

Type

integer

$hierarchy

$hierarchy : string

The hierarchy synckey.

Type

string

$confirmed_synckeys

$confirmed_synckeys : array

Array of synckeys being confirmed during a looping sync.

Type

array

$lastuntil

$lastuntil : integer

Timestamp representing the last planned looping sync end time.

Type

integer

$lasthbsyncstarted

$lasthbsyncstarted : integer

Timestamp of the start of the last looping sync.

Type

integer

$lastsyncendnormal

$lastsyncendnormal : integer

Timestamp of the last looping sync that ended normally.

Type

integer

$_data

$_data : array

The cache data.

Type

array

$_user

$_user : string

The username

Type

string

$_devid

$_devid : string

The device id

Type

string

$_logger

$_logger : \Horde_Log_Logger

Logger

Type

\Horde_Log_Logger

$_dirty

$_dirty : array

Track dirty properties.

Type

array

$_procid

$_procid : integer

Process id for logging.

Type

integer

Methods

__construct()

__construct(\Horde_ActiveSync_State_Base  $state, string  $devid, string  $user, \Horde_Log_Logger  $logger = null) : \Horde_ActiveSync_SyncCache

Constructor

Parameters

\Horde_ActiveSync_State_Base $state

The state driver

string $devid

The device id

string $user

The username

\Horde_Log_Logger $logger

The logger object

Returns

\Horde_ActiveSync_SyncCache

__get()

__get(  $property) 

Parameters

$property

__set()

__set(  $property,   $value) 

Parameters

$property
$value

__isset()

__isset(  $property) 

Parameters

$property

validateCache()

validateCache(boolean  $hb_only = false) : boolean

Validate the cache. Compares the cache timestamp with the current cache timestamp in the state backend. If the timestamps are different, some other request has modified the cache, so it should be invalidated.

Parameters

boolean $hb_only

If true, only validate the hb timestamps. @since 2.4.0

Returns

boolean

loadCacheFromStorage()

loadCacheFromStorage() 

Repopulate the cache data from storage.

validateTimestamps()

validateTimestamps() : boolean

Perform some sanity checking on the various timestamps to ensure we are in a valid state. Basically checks that we are not currently running a looping sync and that the last looping sync ending normally.

Returns

boolean

updateTimestamp()

updateTimestamp() 

Update the cache timestamp to the current time.

getCollections()

getCollections(boolean  $requireKey = true) : array

Return all the collections in the syncCache.

Parameters

boolean $requireKey

If true, only return collections with an existing synckey in the cache. Otherwise return all collections.

Returns

array

countCollections()

countCollections() 

Return the count of available collections in the cache

clearCollections()

clearCollections() 

Remove all collection data.

collectionExists()

collectionExists(\stirng  $collectionid) : boolean

Check for the existance of a specific collection in the cache.

Parameters

\stirng $collectionid

The collection id to search for.

Returns

boolean

setPingableCollection()

setPingableCollection(string  $id) 

Set a specific collection to be PINGable.

Parameters

string $id

The collection id.

removePingableCollection()

removePingableCollection(  $id) 

Set a collection as non-PINGable.

Parameters

$id

collectionIsPingable()

collectionIsPingable(string  $id) : boolean

Check if a specified collection is PINGable.

Parameters

string $id

The collection id.

Returns

boolean

setPingChangeFlag()

setPingChangeFlag(string  $id) 

Set the ping change flag on a collection. Indicatates that the last PING was terminated with a change in this collection.

Parameters

string $id

The collection id.

Throws

\InvalidArgumentException

hasPingChangeFlag()

hasPingChangeFlag(string  $collectionid) : boolean

Checks the status of the ping change flag. If true, the last PING request detected a change in the specified collection.

Parameters

string $collectionid

The collection id to check.

Returns

boolean

resetPingChangeFlag()

resetPingChangeFlag(string  $id) 

Reset the specified collection's ping change flag.

Parameters

string $id

The collectionid to reset.

refreshCollections()

refreshCollections() 

Refresh the cached collections from the state backend.

save()

save() 

Save the synccache to storage.

addCollection()

addCollection(array  $collection) 

Add a new collection to the cache

Parameters

array $collection

The collection array

removeCollection()

removeCollection(string  $id, boolean  $purge = true) 

Remove a collection from the cache.

Parameters

string $id

The collection id.

boolean $purge

If true, completely remove the collection entry otherwise, just resets the synckey.

updateWindowSize()

updateWindowSize(string  $id,   $windowsize) 

Update the windowsize for the specified collection.

Parameters

string $id

The collection id.

$windowsize

updateFiltertype()

updateFiltertype(string  $id, integer  $filtertype) 

Update the filtertype for the specified collection.

Parameters

string $id

The collection id.

integer $filtertype

The updated filtertype.

clearCollectionKeys()

clearCollectionKeys() 

Clear all synckeys from the known collections.

addConfirmedKey()

addConfirmedKey(string  $key) 

Add a confirmed synckey to the cache.

Parameters

string $key

The synckey to add.

removeConfirmedKey()

removeConfirmedKey(string  $key) 

Remove a confirmed sycnkey from the cache

Parameters

string $key

The synckey to remove.

updateCollection()

updateCollection(array  $collection, array  $options = array()) 

Update a collection in the cache.

Parameters

array $collection

The collection data to add/update.

array $options

Options:

  • newsynckey: (boolean) Set the new synckey in the collection. DEFAULT: false (Do not set the new synckey).
  • unsetChanges: (boolean) Unset the GETCHANGES flag in the collection. DEFAULT: false (Do not unset the GETCHANGES flag).
  • unsetPingChangeFlag: (boolean) Unset the PINGCHANGES flag in the collection. DEFUALT: false (Do not uset the PINGCHANGES flag). @since 2.3.0

validateCollectionsFromCache()

validateCollectionsFromCache(array  $collections) 

Validate the collections from the cache and fill in any missing values from the folder cache.

Parameters

array $collections

A reference to an array of collections.

getFolders()

getFolders() 

Return the folders cache.

clearFolders()

clearFolders() 

Clear the folder cache

refreshFolderCache()

refreshFolderCache() 

Refresh the folder cache from the backend.

updateFolder()

updateFolder(\Horde_ActiveSync_Message_Folder  $folder) 

Update a folder entry in the cache.

Parameters

\Horde_ActiveSync_Message_Folder $folder

The folder object.

deleteFolder()

deleteFolder(string  $folder) 

Remove a folder from the cache

Parameters

string $folder

The folder id to remove.

getFolder()

getFolder(string  $folder) : array|boolean

Return an entry from the folder cache.

Parameters

string $folder

The folder id to return.

Returns

array|boolean —

The folder cache array entry, false if not found.

delete()

delete() 

Delete the entire synccache from the backend.

_isValidProperty()

_isValidProperty(  $property) 

Parameters

$property

_markCollectionsDirty()

_markCollectionsDirty(boolean  $id) 

Mark specific collection as dirty, but only if the entire collection data is not already marked dirty.

Parameters

boolean $id

The collection to mark dirty.