示例#1
0
 /**
  * @param XmlDocument $_xmlObj
  */
 function PrintXML(&$_xmlObj, $_startTime = null)
 {
     global $BackgroundXmlParam;
     if ($_xmlObj) {
         if (isset($_SESSION[ISINFOERROR], $_SESSION[INFORMATION]) && $_SESSION[ISINFOERROR]) {
             $_xmlNode = new XmlDomNode('error', $_SESSION[INFORMATION], true);
             $_xmlObj->XmlRoot->AppendChild($_xmlNode);
             unset($_SESSION[ISINFOERROR], $_SESSION[INFORMATION]);
         }
         if ($BackgroundXmlParam === 1) {
             $_xmlObj->XmlRoot->AppendAttribute('background', 1);
         }
         echo $_xmlObj->ToString();
         if (null !== $_startTime) {
             $_log =& CLog::CreateInstance();
             $_log->WriteLine('XML Time: ' . (getmicrotime() - $_startTime));
         }
         exit;
     }
     exit;
 }
示例#2
0
                    $sug->AppendAttribute('value', $suggestWord);
                    $node->AppendChild($sug);
                    unset($sug);
                }
                $node->AppendAttribute('action', 'suggest');
                $response->XmlRoot->AppendChild($node);
                break;
        }
    }
    print $response->ToString();
} else {
    // if error ocured
    $response = new XmlDocument();
    $response->CreateElement('webmail');
    $node = new XmlDomNode('spellcheck');
    $node->AppendAttribute('action', 'error');
    $node->AppendAttribute('errorstr', $sp->_error);
    $node->AppendChild($err);
    $response->XmlRoot->AppendChild($node);
    print $response->ToString();
}
/**
 * @param string $string
 * @return string
 */
function obLogResponse($string)
{
    global $log;
    $log->WriteLine(">>>[Spellchecker]>>>\r\n" . $string);
    return $string;
}
示例#3
0
/**
 * @param XmlDocument $xmlObj
 */
function printXML(&$xmlObj)
{
    if (isset($_SESSION[ISINFOERROR], $_SESSION[INFORMATION]) && $_SESSION[ISINFOERROR]) {
        $xmlNode =& new XmlDomNode('error');
        $xmlNode->Value = $_SESSION[INFORMATION];
        $xmlObj->XmlRoot->AppendChild($xmlNode);
        unset($_SESSION[ISINFOERROR], $_SESSION[INFORMATION]);
    }
    exit($xmlObj->ToString());
}
示例#4
0
/**
 * @param string $_string
 * @return string
 */
function Qitsra($_string)
{
    $_log =& CLog::CreateInstance();
    if ($_log->Enabled && strlen(trim($_string)) > 0) {
        if (!USE_FULLPARSE_XML_LOG) {
            $_log->WriteLine('>>>[server_xml]>>>' . "\r\n" . $_string);
        } else {
            $_xmlTemp = new XmlDocument();
            $_xmlTemp->ParseFromString($_string);
            $_log->WriteLine('>>>[server_xml]>>>' . "\r\n" . $_xmlTemp->ToString(true));
        }
    }
    if (USE_PROCESSING_GZIP) {
        $_string = obStartGzip($_string);
    }
    return $_string;
}