\Horde_SyncMl_Command_SyncHdr

The Horde_SyncMl_Command_SyncHdr class provides a SyncML implementation of the SyncHdr as defined in SyncML Representation Protocol, version 1.1, section 5.2.2.

SyncHdr is not really a sync command, but this class takes advantage of the XML parser in Horde_SyncMl_Command.

Copyright 2006-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.

Summary

Methods
Properties
Constants
__construct()
startElement()
endElement()
characters()
getCommandName()
handleCommand()
factory()
setupState()
$user
$credData
$credFormat
$credType
No constants found
No protected methods found
$_cmdName
$_cmdID
$_stack
$_chars
$_outputHandler
$_sessionID
$_version
$_message
$_targetURI
$_sourceURI
$_maxMsgSize
$_maxObjSize
N/A
No private methods found
No private properties found
N/A

Properties

$user

$user : string

Username as specified in the <LocName> element.

Type

string

$credData

$credData : string

Authentication credential as specified by the <Cred><Data> element.

Type

string

$credFormat

$credFormat : string

Encoding format of $credData as specified in the <Cred><Meta><Format> element like 'b64'.

Type

string

$credType

$credType : string

Media type of $credData as specified in the <Cred><Meta><Type> element like 'auth-basic'.

Type

string

$_cmdName

$_cmdName : string

Name of the command.

Must be overwritten by a sub class.

Type

string

$_cmdID

$_cmdID : integer

The command ID (<CmdID>).

Type

integer

$_stack

$_stack : array

Stack for holding the XML elements during creation of the object from the XML event flow.

Type

array

$_chars

$_chars : string

Buffer for the parsed character data.

Type

string

$_outputHandler

$_outputHandler : \Horde_SyncMl_XmlOutput

A Horde_SyncMl_XmlOutput instance responsible for generating the output.

Type

\Horde_SyncMl_XmlOutput

$_sessionID

$_sessionID : string

Id of this SyncML session as specified in the <SessionID> element.

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

Type

string

$_version

$_version : integer

SyncML protocol version as specified in the <VerProto> element.

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

Type

integer

$_message

$_message : integer

Id of the current message as specified in the <MsgID> element.

Type

integer

$_targetURI

$_targetURI : string

The target URI as specified by the <Target><LocURI> element.

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

Type

string

$_sourceURI

$_sourceURI : string

The source URI as specified by the <Source><LocURI> element.

Type

string

$_maxMsgSize

$_maxMsgSize : integer

Maximum size of a SyncML message in bytes as specified by the <Meta><MaxMsgSize> element.

Type

integer

$_maxObjSize

$_maxObjSize : integer

Maximum size of a SyncML object in bytes as specified by the <Meta><MaxObjSize> element.

Type

integer

Methods

__construct()

__construct(\Horde_SyncMl_XmlOutput  $outputHandler) 

Constructor.

Parameters

\Horde_SyncMl_XmlOutput $outputHandler

A Horde_SyncMl_XmlOutput object.

startElement()

startElement(string  $uri, string  $element, array  $attrs) 

Start element handler for the XML parser, delegated from Horde_SyncMl_ContentHandler::startElement().

Parameters

string $uri

The namespace URI of the element.

string $element

The element tag name.

array $attrs

A hash with the element's attributes.

endElement()

endElement(string  $uri, string  $element) 

End element handler for the XML parser, delegated from Horde_SyncMl_ContentHandler::endElement().

Parameters

string $uri

The namespace URI of the element.

string $element

The element tag name.

characters()

characters(string  $str) 

Character data handler for the XML parser, delegated from Horde_SyncMl_ContentHandler::characters().

Parameters

string $str

The data string.

getCommandName()

getCommandName() : string

Returns the command name this instance is reponsible for.

Returns

string —

The command name this object is handling.

handleCommand()

handleCommand(  $debug = false) 

This method is supposed to implement the actual business logic of the command once the XML parsing is complete.

Parameters

$debug

factory()

factory(string  $command, \Horde_SyncMl_XmlOutput  $outputHandler) : \Horde_SyncMl_Command

Attempts to return a concrete Horde_SyncMl_Command instance based on $command.

Parameters

string $command

The type of the concrete Horde_SyncMl_Comment subclass to return.

\Horde_SyncMl_XmlOutput $outputHandler

A Horde_SyncMl_XmlOutput object.

Returns

\Horde_SyncMl_Command

The newly created concrete Horde_SyncMl_Command instance, or false on error.

setupState()

setupState() 

Starts the PHP session and instantiates the global Horde_SyncMl_State object if doesn't exist yet.