/** * Function: decode * * Decodes the given XML node. The optional "into" * argument specifies an existing object to be * used. If no object is given, then a new instance * is created using the constructor from the codec. * * The function returns the passed in object or * the new instance if no object was given. * * Parameters: * * node - XML node to be decoded. * into - Optional object to be decodec into. */ function decode($node, $into = null) { $obj = null; if (isset($node) && $node->nodeType == XML_ELEMENT_NODE) { $dec = mxCodecRegistry::getCodec($node->nodeName); try { if (isset($dec)) { $obj = $dec->decode($this, $node, $into); } else { $obj = $node->cloneNode(true); $obj->removeAttribute("as"); } } catch (Exception $ex) { // ignore mxLog::debug("Cannot decode " . $node->nodeName . ": {$ex}"); throw $ex; } } return $obj; }
/** * Function: decodeAttribute * * Reads the given attribute into the specified object. */ function decodeAttribute($dec, $attr, &$obj) { $name = $attr->nodeName; if ($name != "as" && $name != "id") { // Converts the string true and false to their boolean values. // This may require an additional check on the obj to see if // the existing field is a boolean value or uninitialized, in // which case we may want to convert true and false to a string. $value = $this->convertValueFromXml($attr->nodeValue); $fieldname = $this->getFieldName($name); if ($this->isReference($obj, $fieldname, $value, false)) { $tmp = $dec->getObject($value); if (!isset($tmp)) { mxLog::warn("mxObjectCodec.decode: No object for " . $this->getName() . ".{$fieldname}={$value}"); return; // exit } $value = $tmp; } if (!$this->isExcluded($obj, $fieldname, $value, false)) { //mxLog.debug(mxCodecRegistry::getName($obj)."$name=$value"); $obj->{$fieldname} = $value; } } }
/** * Function: writeln * * Writes a line with a linefeed to the log. */ static function writeln($text) { mxLog::write("{$text}\n"); }
session_start(); session_commit(); if ($_SESSION['requestid'] != $requestid) { mxLog::debug("request {$requestid} has died"); } else { if (filesize($filename) > 0) { mxLog::debug("request {$requestid} leaves: " . filesize($filename) . " bytes"); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/xhtml+xml"); // Sends the changes to the client echo "<message>"; echo "<delta>"; $fp = fopen($filename, "r+"); fpassthru($fp); ftruncate($fp, 0); fflush($fp); fclose($fp); echo "</delta>"; echo "</message>"; } else { touch($filename); } } } } } mxLog::leave(); mxLog::close();