CVSROOT: /sources/phpgroupware Module name: syncml Changes by: Johan Gunnarsson <johang> 07/07/30 21:07:50
Modified files: . : syncml.php inc : class.sosession.inc.php class.syncml_command_add.inc.php class.syncml_command_replace.inc.php class.syncml_response.inc.php class.xml_mapper.inc.php test : head_pre.php Log message: * Fix for last two test groups in SyncML Conformance Test Suite, which means all test groups pass. Yay! * Fixes for PHP4 compatibility. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/syncml/syncml.php?cvsroot=phpgroupware&r1=1.1.1.1&r2=1.2 http://cvs.savannah.gnu.org/viewcvs/syncml/inc/class.sosession.inc.php?cvsroot=phpgroupware&r1=1.1.1.1&r2=1.2 http://cvs.savannah.gnu.org/viewcvs/syncml/inc/class.syncml_command_add.inc.php?cvsroot=phpgroupware&r1=1.1.1.1&r2=1.2 http://cvs.savannah.gnu.org/viewcvs/syncml/inc/class.syncml_command_replace.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.1.1.1&r2=1.2 http://cvs.savannah.gnu.org/viewcvs/syncml/inc/class.xml_mapper.inc.php?cvsroot=phpgroupware&r1=1.1.1.1&r2=1.2 http://cvs.savannah.gnu.org/viewcvs/syncml/test/head_pre.php?cvsroot=phpgroupware&r1=1.1.1.1&r2=1.2 Patches: Index: syncml.php =================================================================== RCS file: /sources/phpgroupware/syncml/syncml.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -b -r1.1.1.1 -r1.2 --- syncml.php 30 Jul 2007 13:04:38 -0000 1.1.1.1 +++ syncml.php 30 Jul 2007 21:07:49 -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: syncml.php,v 1.1.1.1 2007/07/30 13:04:38 johang Exp $ + * @version $Id: syncml.php,v 1.2 2007/07/30 21:07:49 johang Exp $ */ ob_start(); @@ -26,7 +26,7 @@ require('../header.inc.php'); // this is a ugly, ugly hack - $GLOBALS['phpgw']->db->query('TRUNCATE phpgw_access_log'); + //$GLOBALS['phpgw']->db->query('TRUNCATE phpgw_access_log'); require 'inc/xml_functions.inc.php'; require 'inc/class.xml_offset_mapper.inc.php'; @@ -36,8 +36,8 @@ if(!isset($_SERVER['CONTENT_TYPE']) || $_SERVER['REQUEST_METHOD'] != 'POST') { - // exit('I\'m a SyncML server (1)'); - $_SERVER['CONTENT_TYPE'] = ''; + exit('I\'m a SyncML server (1)'); + //$_SERVER['CONTENT_TYPE'] = ''; } switch($_SERVER['CONTENT_TYPE']) @@ -51,8 +51,8 @@ implode("\r\n", file('php://input'))); break; default: - // exit('I\'m a SyncML server (2)'); - $GLOBALS['HTTP_RAW_POST_DATA'] = ''; + exit('I\'m a SyncML server (2)'); + //$GLOBALS['HTTP_RAW_POST_DATA'] = ''; } $message = new syncml_message(); @@ -72,7 +72,8 @@ unset($body, $GLOBALS['HTTP_RAW_POST_DATA']); // execute everything - $message->execute()->print_response(); + $response = $message->execute(); + $response->print_response(); switch($_SERVER['CONTENT_TYPE']) { Index: inc/class.sosession.inc.php =================================================================== RCS file: /sources/phpgroupware/syncml/inc/class.sosession.inc.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -b -r1.1.1.1 -r1.2 --- inc/class.sosession.inc.php 30 Jul 2007 13:04:39 -0000 1.1.1.1 +++ inc/class.sosession.inc.php 30 Jul 2007 21:07:50 -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.sosession.inc.php,v 1.1.1.1 2007/07/30 13:04:39 johang Exp $ + * @version $Id: class.sosession.inc.php,v 1.2 2007/07/30 21:07:50 johang Exp $ */ /** @@ -50,12 +50,11 @@ * @return int Session ID * @access private */ - // todo: bo-so-layer structure maybe function get_session_mapping($header) { - $syncml_hash = self::generate_session_hash($header); + $syncml_hash = $this->generate_session_hash($header); - self::clean_session_mappings(); + $this->clean_session_mappings(); $GLOBALS['phpgw']->db->query(sprintf(' UPDATE phpgw_syncml_session @@ -82,7 +81,7 @@ $new_phpgw_sid = md5( $GLOBALS['phpgw']->common->randomstring(15)); - self::set_session_mapping( + $this->set_session_mapping( $syncml_hash, $new_phpgw_sid); $GLOBALS['phpgw']->session->read_session($new_phpgw_sid); return $new_phpgw_sid; @@ -93,7 +92,7 @@ function remove_session_mapping($header) { - $syncml_hash = self::generate_session_hash($header); + $syncml_hash = $this->generate_session_hash($header); $GLOBALS['phpgw']->db->query(sprintf(" DELETE FROM phpgw_syncml_session @@ -110,10 +109,9 @@ * @param $syncml_header Either the synchdr xml arrasy or a string. * @param $phpgw_sid phpgw session id. */ - // todo: bo-so-layer structure here? function set_session_mapping($header, $phpgw_sid) { - $syncml_hash = self::generate_session_hash($header); + $syncml_hash = $this->generate_session_hash($header); $GLOBALS['phpgw']->db->query(sprintf(" DELETE FROM phpgw_syncml_session Index: inc/class.syncml_command_add.inc.php =================================================================== RCS file: /sources/phpgroupware/syncml/inc/class.syncml_command_add.inc.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -b -r1.1.1.1 -r1.2 --- inc/class.syncml_command_add.inc.php 30 Jul 2007 13:04:38 -0000 1.1.1.1 +++ inc/class.syncml_command_add.inc.php 30 Jul 2007 21:07:50 -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_add.inc.php,v 1.1.1.1 2007/07/30 13:04:38 johang Exp $ + * @version $Id: class.syncml_command_add.inc.php,v 1.2 2007/07/30 21:07:50 johang Exp $ */ require_once 'inc/constants.inc.php'; @@ -65,8 +65,9 @@ // rerun the command $this->execute($response, $session, $database); return; - case SYNCML_STATUS_CHUNKEDITEMACCEPTEDANDBUFFERED: case SYNCML_STATUS_SIZEMISMATCH: + $this->reset_chunking($session); + case SYNCML_STATUS_CHUNKEDITEMACCEPTEDANDBUFFERED: $code = $status; break; default: Index: inc/class.syncml_command_replace.inc.php =================================================================== RCS file: /sources/phpgroupware/syncml/inc/class.syncml_command_replace.inc.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -b -r1.1.1.1 -r1.2 --- inc/class.syncml_command_replace.inc.php 30 Jul 2007 13:04:39 -0000 1.1.1.1 +++ inc/class.syncml_command_replace.inc.php 30 Jul 2007 21:07:50 -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_replace.inc.php,v 1.1.1.1 2007/07/30 13:04:39 johang Exp $ + * @version $Id: class.syncml_command_replace.inc.php,v 1.2 2007/07/30 21:07:50 johang Exp $ */ require_once 'inc/constants.inc.php'; @@ -65,8 +65,9 @@ // rerun the command $this->execute($response, $session, $database); return; - case SYNCML_STATUS_CHUNKEDITEMACCEPTEDANDBUFFERED: case SYNCML_STATUS_SIZEMISMATCH: + $this->reset_chunking($session); + case SYNCML_STATUS_CHUNKEDITEMACCEPTEDANDBUFFERED: $code = $status; break; default: Index: inc/class.syncml_response.inc.php =================================================================== RCS file: /sources/phpgroupware/syncml/inc/class.syncml_response.inc.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -b -r1.1.1.1 -r1.2 --- inc/class.syncml_response.inc.php 30 Jul 2007 13:04:39 -0000 1.1.1.1 +++ inc/class.syncml_response.inc.php 30 Jul 2007 21:07:50 -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_response.inc.php,v 1.1.1.1 2007/07/30 13:04:39 johang Exp $ + * @version $Id: class.syncml_response.inc.php,v 1.2 2007/07/30 21:07:50 johang Exp $ */ define('METINF', 'xmlns="syncml:metinf"'); @@ -129,7 +129,7 @@ function add_alert($code, $item, $supportlargeobj = FALSE) { - if(!$supportlargeobj) + if(!$supportlargeobj && isset($item['meta'])) { unset($item['meta']['maxobjsize']); } Index: inc/class.xml_mapper.inc.php =================================================================== RCS file: /sources/phpgroupware/syncml/inc/class.xml_mapper.inc.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -b -r1.1.1.1 -r1.2 --- inc/class.xml_mapper.inc.php 30 Jul 2007 13:04:39 -0000 1.1.1.1 +++ inc/class.xml_mapper.inc.php 30 Jul 2007 21:07:50 -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.xml_mapper.inc.php,v 1.1.1.1 2007/07/30 13:04:39 johang Exp $ + * @version $Id: class.xml_mapper.inc.php,v 1.2 2007/07/30 21:07:50 johang Exp $ */ require_once 'inc/constants.inc.php'; @@ -69,7 +69,7 @@ function data($parser, $data) { - $this->data .= trim($data); + $this->data .= $data; } function &get_last_path_element_by_ref() Index: test/head_pre.php =================================================================== RCS file: /sources/phpgroupware/syncml/test/head_pre.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -b -r1.1.1.1 -r1.2 --- test/head_pre.php 30 Jul 2007 13:04:38 -0000 1.1.1.1 +++ test/head_pre.php 30 Jul 2007 21:07:50 -0000 1.2 @@ -8,8 +8,8 @@ 'nocachecontrol' => True ); - require '../header.inc.php'; - require 'inc/class.somappings.inc.php'; + require '../../header.inc.php'; + require '../inc/class.somappings.inc.php'; var_dump($GLOBALS['phpgw']->session->create('demo', md5('guest'), 'md5')); _______________________________________________ phpGroupWare-cvs mailing list phpGroupWare-cvs@gnu.org http://lists.gnu.org/mailman/listinfo/phpgroupware-cvs