function createBody() { if (strlen($GLOBALS["HTTP_RAW_POST_DATA"]) == 0) { echo "The XML-RPC gateway is installed correctly"; exit; } $GLOBALS['amfphp']['encoding'] = 'xmlrpc'; $body = new MessageBody(); $body->setValue($GLOBALS["HTTP_RAW_POST_DATA"]); return $body; }
function createBody() { $GLOBALS['amfphp']['encoding'] = 'json'; $body = new MessageBody(); $uri = __setUri(); $elements = explode('/gateway.json', $uri); if (strlen($elements[1]) == 0) { echo "The JSON gateway is installed correctly. Call like this: json.php/MyClazz.myMethod/arg1/arg2"; exit; } $args = substr($elements[1], 1); $rawArgs = explode('/', $args); if (isset($GLOBALS['HTTP_RAW_POST_DATA'])) { $rawArgs[] = $GLOBALS['HTTP_RAW_POST_DATA']; } $body->setValue($rawArgs); return $body; }