phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] syncml/inc class.syncml_command_synchdr.inc.php...


From: Johan Gunnarsson
Subject: [Phpgroupware-cvs] syncml/inc class.syncml_command_synchdr.inc.php...
Date: Sat, 11 Aug 2007 17:24:37 +0000

CVSROOT:        /sources/phpgroupware
Module name:    syncml
Changes by:     Johan Gunnarsson <johang>       07/08/11 17:24:37

Modified files:
        inc            : class.syncml_command_synchdr.inc.php 
                         class.syncml_response.inc.php 

Log message:
        Backwards compatibility with SyncML 1.0

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/syncml/inc/class.syncml_command_synchdr.inc.php?cvsroot=phpgroupware&r1=1.1.1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/syncml/inc/class.syncml_response.inc.php?cvsroot=phpgroupware&r1=1.2&r2=1.3

Patches:
Index: class.syncml_command_synchdr.inc.php
===================================================================
RCS file: 
/sources/phpgroupware/syncml/inc/class.syncml_command_synchdr.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -b -r1.1.1.1 -r1.2
--- class.syncml_command_synchdr.inc.php        30 Jul 2007 13:04:38 -0000      
1.1.1.1
+++ class.syncml_command_synchdr.inc.php        11 Aug 2007 17:24:37 -0000      
1.2
@@ -7,7 +7,7 @@
         * @copyright Copyright (c) 2007 Free Software Foundation, Inc.
         * @license   GNU General Public License 3 or later
         * @package   syncml
-        * @version   $Id: class.syncml_command_synchdr.inc.php,v 1.1.1.1 
2007/07/30 13:04:38 johang Exp $
+        * @version   $Id: class.syncml_command_synchdr.inc.php,v 1.2 
2007/08/11 17:24:37 johang Exp $
         */
 
        require_once 'inc/class.syncml_command.inc.php';
@@ -87,6 +87,7 @@
                        {
                                case '1.0':
                                case '1.1':
+                                       
$response->set_syncml_namespace_version($this->verdtd);
                                        break;
                                default:
                                        $this->handle_failure(

Index: class.syncml_response.inc.php
===================================================================
RCS file: /sources/phpgroupware/syncml/inc/class.syncml_response.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- class.syncml_response.inc.php       30 Jul 2007 21:07:50 -0000      1.2
+++ class.syncml_response.inc.php       11 Aug 2007 17:24:37 -0000      1.3
@@ -7,7 +7,7 @@
         * @copyright Copyright (c) 2007 Free Software Foundation, Inc.
         * @license   GNU General Public License 3 or later
         * @package   syncml
-        * @version   $Id: class.syncml_response.inc.php,v 1.2 2007/07/30 
21:07:50 johang Exp $
+        * @version   $Id: class.syncml_response.inc.php,v 1.3 2007/08/11 
17:24:37 johang Exp $
         */
 
        define('METINF', 'xmlns="syncml:metinf"');
@@ -28,16 +28,22 @@
                var $is_final = FALSE;
                var $global_status_code;
 
+               var $root_namespace = '';
                var $header = '';
                var $header_cred = '';
                var $commands = array();
 
                var $status_count = 0;
 
+               function syncml_response()
+               {
+                       $this->root_namespace = 'SYNCML:SYNCML1.1';
+               }
+
                function print_response()
                {
                        echo '<?xml version="1.0" encoding="UTF-8"?>';
-                       echo '<SyncML xmlns="SYNCML:SYNCML1.1">';
+                       echo '<SyncML xmlns="', $this->root_namespace, '">';
                        echo '<SyncHdr>', $this->header, $this->header_cred, 
'</SyncHdr>';
                        echo '<SyncBody>', implode('', $this->commands);
                        echo ($this->is_final ? '<Final/>' : ''), '</SyncBody>';
@@ -143,6 +149,11 @@
                                '</Alert>';
                }
 
+               function set_syncml_namespace_version($version)
+               {
+                       $this->root_namespace = 'SYNCML:SYNCML' . $version;
+               }
+
                function set_header($verdtd, $verproto, $sessionid, $msgid,
                        $trg_lu, $trg_ln, $src_lu, $src_ln)
                {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]