[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/SyncML/ -> Backend.php (sommaire)

(pas de description)

Poids: 675 lignes (24 kb)
Inclus ou requis: 1 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

SyncML_Backend_Horde:: (21 méthodes):
  SyncML_Backend_Horde()
  retrieveEntry()
  getServerModifications()
  getServerDeletions()
  getServerAdditions()
  importEntry()
  deleteEntry()
  replaceEntry()
  getSyncSummary()
  writeSyncSummary()
  createUidMap()
  getChangeTS()
  getSuid()
  getCuid()
  logMessage()
  mapClientCategory2Server()
  mapServerCategory2Client()
  _loadCategoriesMap()
  _storeCategoriesMap()
  dieOnError()
  _getOb()


Classe: SyncML_Backend_Horde  - X-Ref

SyncML Backend for the Horde Application framework.

The backend provides the following functionality:

1) handling of the actual data, i.e.
a) add/replace/delete entries to and retrieve entries from the
backend
b) retrieve history to find out what entries have been changed
2) managing of the map between cliend IDs and server IDs
3) store information about sync anchors (timestamps) of previous
successfuls sync sessions
4) session handling (not yet, still to be done)
5) authorisation (not yet, still to be done)
6) logging

Copyright 2005-2006 Karsten Fourmont <karsten@horde.org>

See the enclosed file COPYING for license information (LGPL). If you did not
receive this file, see http://www.fsf.org/copyleft/lgpl.html.

$Horde: framework/SyncML/SyncML/Backend.php,v 1.8.2.8 2006/07/18 12:00:56 jan Exp $

SyncML_Backend_Horde()   X-Ref
Pas de description

retrieveEntry($database, $suid, $contentType)   X-Ref
Retrieves an entry from the backend.

param: string $database   Database to scan. i.e.
param: string $suid       Server unique id of the entry: for horde
param: string contentType Content-Type: the mime type in which the
return: mixed             A string with the data entry or

getServerModifications($syncIdentifier, $database, $from_ts, $to_ts)   X-Ref
Get entries that have been modified in the server database.

param: string $syncIdentifier  Identifies the client device to allow the
param: string $database        Database to scan. i.e.
param: integer $from_ts        Start timestamp.
param: integer $to_ts          Exclusive end timestamp. Not yet
return: array  PEAR_Error or assoc array of changes with key=suid,

getServerDeletions($syncIdentifier, $database, $from_ts, $to_ts)   X-Ref
Get entries that have been deleted from the server database.

param: string $database  Database to scan. i.e.
param: integer $from_ts
param: integer $to_ts    Exclusive
return: array  PEAR_Error or assoc array of deletions with key=suid,

getServerAdditions($syncIdentifier, $database, $from_ts, $to_ts)   X-Ref
Get entries that have been added to the server database.

param: string $database  Database to scan. i.e.
param: integer $from_ts
param: integer $to_ts    Exclusive
return: array  PEAR_Error or assoc array of deletions with key=suid,

importEntry($syncIdentifier, $database, $content, $contentType, $cuid)   X-Ref
Adds an entry into the server database.

param: string $database     Database where to add.
param: string $content      The actual data
param: string $contentType  Mimetype of $content
param: string $cuid         Client ID of this entry (for map)
return: array  PEAR_Error or suid (Horde guid) of new entry

deleteEntry($syncIdentifier, $database, $cuid)   X-Ref
Deletes an entry from the server database.

param: string $database  Database where to add.
param: string $cuid      Client ID of the entry
return: array  PEAR_Error or suid (Horde guid) of deleted entry.

replaceEntry($syncIdentifier, $database, $content, $contentType, $cuid)   X-Ref
Replaces an entry in the server database.

param: string $database     Database where to replace.
param: string $content      The actual data
param: string $contentType  Mimetype of $content
param: string $cuid         Client ID of this entry
return: array  PEAR_Error or suid (Horde guid) of modified entry.

getSyncSummary($syncIdentifier, $type)   X-Ref
Retrieves information about the previous sync if any. Returns
false if no info found or a DateTreeObject with at least the
following attributes:

ClientAnchor: the clients Next Anchor of the previous sync.
ServerAnchor: the Server Next Anchor of the previous sync.

writeSyncSummary($syncIdentifier,$clientAnchorNext, $serverAnchorNext)   X-Ref
After a successful sync, the client and server's Next Anchors
are written to the database so they can be used to negotiate
upcoming syncs.


createUidMap($syncIdentifier, $type, $cuid, $suid, $ts=0)   X-Ref
Create a map entries to map between server and client IDs.

Puts a given client $cuid and Horde server $suid pair into the
map table to allow mapping between the client's and server's
IDs.  Actually there are two maps: from the suid to the cuid
and vice versa.
If an entry already exists, it is overwritten.

getChangeTS($syncIdentifier, $database, $suid)   X-Ref
Returns the timestamp (if set) of the last change to the
obj:guid, that was caused by the client.


getSuid($syncIdentifier, $type, $cuid)   X-Ref
Retrieves the Horde server guid (like
kronolith:0d1b415fc124d3427722e95f0e926b75) for a given client
cuid. Returns false if no such id is stored yet.


getCuid($syncIdentifier, $database, $suid)   X-Ref
Converts a suid server id (i.e. Horde GUID) to a cuid client ID
as used by the sync client (like 12) returns false if no such
id is stored yet.


logMessage($message, $file = __FILE__, $line = __LINE__,$priority = PEAR_LOG_INFO)   X-Ref
Logs a message in the backend.

param: mixed $message     Either a string or a PEAR_Error object.
param: string $file       What file was the log function called from
param: integer $line      What line was the log function called from
param: integer $priority  The priority of the message. One of:

mapClientCategory2Server($clientCategory, $summary = 'unknown')   X-Ref
Pas de description

mapServerCategory2Client($serverCategory, $summary = 'unknown')   X-Ref
Pas de description

_loadCategoriesMap()   X-Ref
Pas de description

_storeCategoriesMap()   X-Ref
Pas de description

dieOnError($obj, $file = __FILE__, $line = __LINE__)   X-Ref
This is a small helper function that can be included to check
whether a given $obj is a PEAR_Error or not. If so, it logs
to debug, var_dumps the $obj and exits.


_getOb($name)   X-Ref
Pas de description



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7