/**
  * Analyze the HTTP request and set the params property
  */
 protected function _initParams()
 {
     $requestXml = file_get_contents('php://input');
     // Decode the request
     list($nom, $vars) = jXmlRpc::decodeRequest($requestXml);
     list($module, $action) = explode(':', $nom, 2);
     if (count($vars) == 1 && is_array($vars[0])) {
         $this->params = $vars[0];
     }
     $this->params['params'] = $vars;
     // Definition of action to use and its parameters
     $this->params['module'] = $module;
     $this->params['action'] = $action;
 }
 public function outputErrors()
 {
     $errorMessage = jApp::coord()->getGenericErrorMessage();
     $e = jApp::coord()->getErrorMessage();
     if ($e) {
         $errorCode = $e->getCode();
     } else {
         $errorCode = -1;
     }
     $this->clearHttpHeaders();
     $content = jXmlRpc::encodeFaultResponse($errorCode, $errorMessage, jApp::config()->charset);
     header("HTTP/1.0 500 Internal Server Error");
     header("Content-Type: text/xml;charset=" . jApp::config()->charset);
     header("Content-length: " . strlen($content));
     echo $content;
 }
 protected function _initParams()
 {
     global $HTTP_RAW_POST_DATA;
     if (isset($HTTP_RAW_POST_DATA)) {
         $requestXml = $HTTP_RAW_POST_DATA;
     } else {
         $requestXml = file('php://input');
         $requestXml = implode("\n", $requestXml);
     }
     list($nom, $vars) = jXmlRpc::decodeRequest($requestXml);
     list($module, $action) = explode(':', $nom, 2);
     if (count($vars) == 1 && is_array($vars[0])) {
         $this->params = $vars[0];
     }
     $this->params['params'] = $vars;
     $this->params['module'] = $module;
     $this->params['action'] = $action;
 }
 public function outputErrors()
 {
     global $gJCoord;
     if (count($gJCoord->errorMessages)) {
         $e = $gJCoord->errorMessages[0];
         $errorCode = $e[1];
         $errorMessage = '[' . $e[0] . '] ' . $e[2] . ' (file: ' . $e[3] . ', line: ' . $e[4] . ')';
     } else {
         $errorMessage = 'Unknown error';
         $errorCode = -1;
     }
     $this->clearHttpHeaders();
     $content = jXmlRpc::encodeFaultResponse($errorCode, $errorMessage, $GLOBALS['gJConfig']->charset);
     header("HTTP/1.0 500 Internal Server Error");
     header("Content-Type: text/xml;charset=" . $GLOBALS['gJConfig']->charset);
     header("Content-length: " . strlen($content));
     echo $content;
 }