Documentation

Horde_SyncMl_State
in package

The Horde_SyncMl_State class provides a SyncML state object.

Copyright 2003-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Tags
author

Anthony Mills amills@pyramid6.com

author

Jan Schneider jan@horde.org

Table of Contents

$authenticated  : bool
Whether this session has authenticated successfully.
$curSyncItem  : Horde_SyncMl_SyncElement
Current sync element sent from client.
$delayedFinal  : bool
Flag that is set if the client sends a Final but we are not finished with the current package and thus can't final this package yet.
$deviceInfo  : Horde_SyncMl_DeviceInfo
Device info provided by the SyncML DevInf data.
$maxMsgSize  : int
The maximum allowed message size in bytes.
$maxObjSize  : int
The maximum allowed object size in bytes.
$messageID  : int
Id of the current message.
$serverChanges  : array<string|int, mixed>
The list of all server changes being sent to the client as a reference for Status responses from the client.
$sessionID  : string
Id of this SyncML session.
$sourceURI  : string
The source URI as sent by the client.
$targetURI  : string
The target URI as sent by the client.
$uriDevInf  : string
<DevInf> namespace uri.
$uriMeta  : string
<Meta> namespace uri.
$user  : string
Username used to authenticate with the backend.
$version  : int
SyncML protocol version.
$wbxml  : bool
Whether WBXML encoding is used.
$_deviceDriver  : string
Name of the appropriate device driver.
$_syncs  : array<string|int, mixed>
Array of Horde_SyncMl_Sync objects.
$_uri  : string
<SyncML> namespace uri.
__construct()  : mixed
Constructor.
getDevice()  : Horde_SyncMl_Device
Returns a Horde_SyncMl_Device instance for the device used in this session.
getDevInfURI()  : mixed
Returns the DevInf URI based on the protocol version.
getPendingSyncs()  : array<string|int, mixed>
Returns all syncs which have pending elements left.
getProtocolName()  : mixed
Returns the protocol name based on the protocol version.
getSync()  : Horde_SyncMl_Sync
getSyncs()  : array<string|int, mixed>
getURI()  : string
Returns the namespace URI for the <SyncML> element.
getVerDTD()  : mixed
Returns the <DevInf><VerDTD> content based on the protocol version.
handleFinal()  : mixed
Propagates final tags here and then further to every sync.
hasPendingSyncs()  : bool
Returns whether there are any pending elements that have not been sent to due to message size restrictions. These will be sent int the next message.
isAllSyncsComplete()  : bool
Returns whether all syncs are in completed state or no syncs are present.
setSync()  : mixed
setVersion()  : mixed
Sets the protocol version

Properties

$authenticated

Whether this session has authenticated successfully.

public bool $authenticated = alse

$curSyncItem

Current sync element sent from client.

public Horde_SyncMl_SyncElement $curSyncItem

Stored in state if one element is split into multiple message packets.

$delayedFinal

Flag that is set if the client sends a Final but we are not finished with the current package and thus can't final this package yet.

public bool $delayedFinal = alse

$maxMsgSize

The maximum allowed message size in bytes.

public int $maxMsgSize = 1000000000
Tags
todo

Change to PHP_INT_MAX.

$maxObjSize

The maximum allowed object size in bytes.

public int $maxObjSize = 1000000000
Tags
todo

Change to PHP_INT_MAX.

$messageID

Id of the current message.

public int $messageID

$serverChanges

The list of all server changes being sent to the client as a reference for Status responses from the client.

public array<string|int, mixed> $serverChanges = array()

$sessionID

Id of this SyncML session.

public string $sessionID

This is not to confuse with the PHP session id, though it is part of the generated PHP session id.

$sourceURI

The source URI as sent by the client.

public string $sourceURI

Can be used to identify the client and is part of the PHP session id.

$targetURI

The target URI as sent by the client.

public string $targetURI

This is normally the URL of the RPC server. However the client is free to send anything.

$uriDevInf

<DevInf> namespace uri.

public string $uriDevInf

$uriMeta

<Meta> namespace uri.

public string $uriMeta

$user

Username used to authenticate with the backend.

public string $user

$version

SyncML protocol version.

public int $version

0 for SyncML 1.0, 1 for SyncML 1.1, etc.

$wbxml

Whether WBXML encoding is used.

public bool $wbxml = alse

$_deviceDriver

Name of the appropriate device driver.

protected string $_deviceDriver

$_syncs

Array of Horde_SyncMl_Sync objects.

protected array<string|int, mixed> $_syncs = array()

$_uri

<SyncML> namespace uri.

protected string $_uri

Methods

__construct()

Constructor.

public __construct(mixed $sourceURI, mixed $user, mixed $sessionID) : mixed
Parameters
$sourceURI : mixed
$user : mixed
$sessionID : mixed
Return values
mixed —

getDevInfURI()

Returns the DevInf URI based on the protocol version.

public getDevInfURI() : mixed
Return values
mixed —

getPendingSyncs()

Returns all syncs which have pending elements left.

public getPendingSyncs() : array<string|int, mixed>
Return values
array<string|int, mixed> —

Array of TargetLocURIs which can be used as a key in getSync() calls.

getProtocolName()

Returns the protocol name based on the protocol version.

public getProtocolName() : mixed
Return values
mixed —

getSyncs()

public getSyncs() : array<string|int, mixed>
Return values
array<string|int, mixed> —

getURI()

Returns the namespace URI for the <SyncML> element.

public getURI() : string
Return values
string —

The namespace URI to use, if any.

getVerDTD()

Returns the <DevInf><VerDTD> content based on the protocol version.

public getVerDTD() : mixed
Return values
mixed —

handleFinal()

Propagates final tags here and then further to every sync.

public handleFinal(mixed &$output[, mixed $debug = false ]) : mixed

This allows the sync objects to determine if they are complete.

Parameters
$output : mixed
$debug : mixed = false
Return values
mixed —

hasPendingSyncs()

Returns whether there are any pending elements that have not been sent to due to message size restrictions. These will be sent int the next message.

public hasPendingSyncs() : bool
Return values
bool —

True if there are pending elements that have yet to be sent.

isAllSyncsComplete()

Returns whether all syncs are in completed state or no syncs are present.

public isAllSyncsComplete() : bool
Return values
bool —

True if all syncs are in completed state.

setVersion()

Sets the protocol version

public setVersion(int $version) : mixed
Parameters
$version : int

The protocol version: 0 for SyncML 1.0, 1 for SyncML 1.1 etc.

Return values
mixed —

Search results