[cvs] [Wiki] changed: SyncMLCustomBackend

Wiki Guest wikiguest at horde.org
Sun Mar 30 20:34:32 UTC 2008


guest [80.217.42.177]  Sun, 30 Mar 2008 16:34:32 -0400

Modified page: http://wiki.horde.org/SyncMLCustomBackend
New Revision:  1.1
Change log:  Fixed parse error, and made input more flexible.

@@ -89,9 +89,16 @@
                        'debug_dir' => '/tmp/sync', // debug output to this
dir, must be writeable be web server
                        'debug_files' => true, // log all (wb)xml packets
received or sent to debug_dir:
                        'log_level' => PEAR_LOG_DEBUG); // log everything

-$response = SyncML_HandleRequest($GLOBALS['HTTP_RAW_POST_DATA'],
$_SERVER['CONTENT_TYPE'], $backend, $backend_parms)
+// Not all phpinstalls have http_raw_post_data set, ini-config needed.
+// Is it also deprecated in later versions? Well, php://input works.
+if( isset($GLOBALS['HTTP_RAW_POST_DATA']) )
+    $input = $GLOBALS['HTTP_RAW_POST_DATA'];
+else
+    $raw_post = file_get_contents('php://input');
+
+$response = SyncML_HandleRequest($input, $_SERVER['CONTENT_TYPE'],
$backend, $backend_parms);
 if (is_a($response, 'PEAR_Error')) {
     header('HTTP/1.0 500 Internal Server Error');
     exit;
 }


More information about the cvs mailing list