Property | Type | Description | |
---|---|---|---|
$_db | Horde_Db_Adapter_Base | A database instance. | |
$_sessionId | string | The session ID used in the Horde session. |
Method | Description | |
---|---|---|
__construct ( array $params ) | Constructor. | |
addEntry ( string $databaseURI, string $content, string $contentType, string $cuid = null ) : array | Adds an entry into the server database. | |
close ( ) | ||
createUidMap ( string $databaseURI, string $cuid, string $suid, integer $timestamp ) | Creates a map entry to map between server and client IDs. | |
deleteEntry ( string $databaseURI, string $cuid ) : boolean | Deletes an entry from the server database. | |
eraseMap ( string $databaseURI ) | Erases all mapping entries for one combination of user, device ID. | |
getServerChanges ( string $databaseURI, integer $from_ts, integer $to_ts, &$adds, &$mods, &$dels ) : boolean | Returns entries that have been modified in the server database. | |
getUserAnchors ( string $user ) : array | Returns all previously written sync anchors for a user. | |
logMessage ( mixed $message, string $priority = 'INFO' ) | Logs a message in the backend. | |
readSyncAnchors ( string $databaseURI ) : mixed | Reads the previously written sync anchors from the database. | |
removeAnchor ( string $user, string $device = null, string $database = null ) : array | Deletes previously written sync anchors for a user. | |
removeMaps ( string $user, string $device = null, string $database = null ) : array | Deletes previously written sync maps for a user. | |
replaceEntry ( string $databaseURI, string $content, string $contentType, string $cuid ) : string | Replaces an entry in the server database. | |
retrieveEntry ( string $databaseURI, string $suid, string $contentType, array $fields ) : mixed | Retrieves an entry from the backend. | |
sessionStart ( string $syncDeviceID, $sessionId, integer $backendMode = Horde_SyncMl_Backend::MODE_SERVER ) | Starts a PHP session. | |
setUser ( string $user ) | Sets the user used for this session. | |
testSetup ( string $user, string $pwd ) | Creates a clean test environment in the backend. | |
testStart ( string $user ) | Prepares the test start. | |
testTearDown ( ) | Tears down the test environment after the test is run. | |
writeSyncAnchors ( string $databaseURI, string $clientAnchorNext, string $serverAnchorNext ) | Stores Sync anchors after a successful synchronization to allow two-way synchronization next time. |
Method | Description | |
---|---|---|
_checkAuthentication ( string $username, string $password ) : boolean | string | Authenticates the user at the backend. | |
_fastsync ( $databaseURI, $from_ts, $to_ts ) | ||
_getChangeTS ( string $databaseURI, string $suid ) : mixed | Returns a timestamp stored in the map for a given Server ID. | |
_getCuid ( string $databaseURI, string $suid ) : mixed | Retrieves the Client ID for a given Server ID from the map. | |
_getSuid ( string $databaseURI, string $cuid ) : mixed | Retrieves the Server ID for a given Client ID from the map. | |
_setAuthenticated ( string $username, string $credData ) : string | Sets a user as being authenticated at the backend. | |
_slowsync ( $databaseURI, $from_ts, $to_ts ) |
public __construct ( array $params ) | ||
$params | array | Any parameters the backend might need. |
protected _getChangeTS ( string $databaseURI, string $suid ) : mixed | ||
$databaseURI | string | URI of database to sync. Like calendar, tasks, contacts or notes. May include optional parameters: tasks?options=ignorecompleted. |
$suid | string | The server ID. |
return | mixed | The previously stored timestamp or false if no entry is found. |
protected _getCuid ( string $databaseURI, string $suid ) : mixed | ||
$databaseURI | string | URI of database to sync. Like calendar, tasks, contacts or notes. May include optional parameters: tasks?options=ignorecompleted. |
$suid | string | The server ID. |
return | mixed | The client ID string or false if no entry is found. |
protected _getSuid ( string $databaseURI, string $cuid ) : mixed | ||
$databaseURI | string | URI of database to sync. Like calendar, tasks, contacts or notes. May include optional parameters: tasks?options=ignorecompleted. |
$cuid | string | The client ID. |
return | mixed | The server ID string or false if no entry is found. |
public addEntry ( string $databaseURI, string $content, string $contentType, string $cuid = null ) : array | ||
$databaseURI | string | URI of Database to sync. Like calendar, tasks, contacts or notes. May include optional parameters: tasks?options=ignorecompleted. |
$content | string | The actual data. |
$contentType | string | MIME type of the content. |
$cuid | string | Client ID of this entry. |
return | array | PEAR_Error or suid (Horde guid) of new entry |
public createUidMap ( string $databaseURI, string $cuid, string $suid, integer $timestamp ) | ||
$databaseURI | string | URI of database to sync. Like calendar, tasks, contacts or notes. May include optional parameters: tasks?options=ignorecompleted. |
$cuid | string | Client ID of the entry. |
$suid | string | Server ID of the entry. |
$timestamp | integer | Optional timestamp. This can be used to 'tag' changes made in the backend during the sync process. This allows to identify these, and ensure that these changes are not replicated back to the client (and thus duplicated). See key concept "Changes and timestamps". |
public deleteEntry ( string $databaseURI, string $cuid ) : boolean | ||
$databaseURI | string | URI of Database to sync. Like calendar, tasks, contacts or notes. May include optional parameters: tasks?options=ignorecompleted. |
$cuid | string | Client ID of the entry. |
return | boolean | True on success or false on failed (item not found). |
public getServerChanges ( string $databaseURI, integer $from_ts, integer $to_ts, &$adds, &$mods, &$dels ) : boolean | ||
$databaseURI | string | URI of Database to sync. Like calendar, tasks, contacts or notes. May include optional parameters: tasks?options=ignorecompleted. |
$from_ts | integer | Start timestamp. |
$to_ts | integer | Exclusive end timestamp. Not yet implemented. |
return | boolean | true |
public getUserAnchors ( string $user ) : array | ||
$user | string | A user name. |
return | array | A hash tree with all devices, databases and sync anchors from the specified user. |
public logMessage ( mixed $message, string $priority = 'INFO' ) | ||
$message | mixed | Either a string or a PEAR_Error object. |
$priority | string | The priority of the message. One of: - EMERG - ALERT - CRIT - ERR - WARN - NOTICE - INFO - DEBUG |
public readSyncAnchors ( string $databaseURI ) : mixed | ||
$databaseURI | string | URI of database to sync. Like calendar, tasks, contacts or notes. May include optional parameters: tasks?options=ignorecompleted. |
return | mixed | Two-element array with client anchor and server anchor as stored in previous writeSyncAnchor() calls. False if no data found. |
public replaceEntry ( string $databaseURI, string $content, string $contentType, string $cuid ) : string | ||
$databaseURI | string | URI of Database to sync. Like calendar, tasks, contacts or notes. May include optional parameters: tasks?options=ignorecompleted. |
$content | string | The actual data. |
$contentType | string | MIME type of the content. |
$cuid | string | Client ID of this entry. |
return | string | PEAR_Error or server ID (Horde GUID) of modified entry. |
public retrieveEntry ( string $databaseURI, string $suid, string $contentType, array $fields ) : mixed | ||
$databaseURI | string | URI of Database to sync. Like calendar, tasks, contacts or notes. May include optional parameters: tasks?options=ignorecompleted. |
$suid | string | Server unique id of the entry: for horde this is the guid. |
$contentType | string | Content-Type: the MIME type in which the public function should return the data. |
$fields | array | Hash of field names and Horde_SyncMl_Property properties with the requested fields. |
return | mixed | A string with the data entry or a PEAR_Error object. |
public sessionStart ( string $syncDeviceID, $sessionId, integer $backendMode = Horde_SyncMl_Backend::MODE_SERVER ) | ||
$syncDeviceID | string | The device ID. |
$backendMode | integer | The backend mode, one of the Horde_SyncMl_Backend::MODE_* constants. |
public testTearDown ( ) |
public writeSyncAnchors ( string $databaseURI, string $clientAnchorNext, string $serverAnchorNext ) | ||
$databaseURI | string | URI of database to sync. Like calendar, tasks, contacts or notes. May include optional parameters: tasks?options=ignorecompleted. |
$clientAnchorNext | string | The client anchor as sent by the client. |
$serverAnchorNext | string | The anchor as used internally by the server. |
protected Horde_Db_Adapter_Base $_db | ||
return | Horde_Db_Adapter_Base |
protected string $_sessionId | ||
return | string |