1: <?php
2: /**
3: * The Horde_SyncMl_Command_Final class provides a SyncML implementation of the
4: * Final command as defined in SyncML Representation Protocol, version 1.1,
5: * section 5.1.7.
6: *
7: * The Final command is an indicator that the SyncML message is the last
8: * message in the current Horde_SyncMl package.
9: *
10: * Copyright 2003-2012 Horde LLC (http://www.horde.org/)
11: *
12: * See the enclosed file COPYING for license information (LGPL). If you
13: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
14: *
15: * @author Karsten Fourmont <karsten@horde.org>
16: * @author Jan Schneider <jan@horde.org>
17: * @package SyncMl
18: */
19: class Horde_SyncMl_Command_Final extends Horde_SyncMl_Command
20: {
21: /**
22: * Name of the command.
23: *
24: * @var string
25: */
26: protected $_cmdName = 'Final';
27:
28: /**
29: * Implements the actual business logic of the Alert command.
30: */
31: public function handleCommand($debug = false)
32: {
33: $state = $GLOBALS['backend']->state;
34:
35: // If the client hasn't sent us device info, request it now.
36: // @todo: only do this once, not in every msg if the client does not
37: // implement DevInf.
38: $di = $state->deviceInfo;
39: if (empty($di->Man)) {
40: $this->_outputHandler->outputGetDevInf();
41: }
42:
43: $GLOBALS['backend']->logMessage('Received <Final> from client.', 'DEBUG');
44:
45: $state->handleFinal($this->_outputHandler, $debug);
46: }
47: }
48: