Beispiel #1
0
 static function _trace($v, $i = null)
 {
     if (me_cunity_debug_Out::$suspended) {
         return;
     }
     $warned = false;
     if ($i !== null && _hx_has_field($i, "customParams")) {
         $i = $i->customParams[0];
     }
     $msg = null;
     if ($i !== null) {
         $msg = _hx_string_or_null($i->fileName) . ":" . _hx_string_or_null($i->methodName) . ":" . _hx_string_rec($i->lineNumber, "") . ":";
     } else {
         $msg = "";
     }
     $msg .= Std::string($v);
     if (me_cunity_debug_Out::$log !== null) {
         me_cunity_debug_Out::$log->writeString(_hx_string_or_null($msg) . "\n");
         me_cunity_debug_Out::$log->flush();
     } else {
         $_g = me_cunity_debug_Out::$traceTarget;
         switch ($_g->index) {
             case 2:
                 error_log($msg);
                 break;
             case 0:
                 php_Lib::hprint(_hx_string_or_null($msg) . "\r\n");
                 break;
             case 1:
                 php_Lib::hprint(_hx_string_or_null(StringTools::htmlEscape($msg, null)) . "<br/>");
                 break;
             case 3:
                 break;
         }
     }
     if (me_cunity_debug_Out::$once) {
         me_cunity_debug_Out::$once = false;
         me_cunity_debug_Out::_trace("i:" . Std::string(Type::typeof($i)), _hx_anonymous(array("fileName" => "Out.hx", "lineNumber" => 130, "className" => "me.cunity.debug.Out", "methodName" => "_trace")));
         me_cunity_debug_Out::dumpObject($i, _hx_anonymous(array("fileName" => "Out.hx", "lineNumber" => 131, "className" => "me.cunity.debug.Out", "methodName" => "_trace")));
     }
 }
Beispiel #2
0
 public function toString()
 {
     if (is_object($_t = $this->nodeType) && !$_t instanceof Enum ? $_t === Xml::$PCData : $_t == Xml::$PCData) {
         if ($this->_fromCustomParser) {
             return StringTools::htmlEscape($this->_nodeValue, null);
         } else {
             return $this->_nodeValue;
         }
     }
     $s = "";
     if (is_object($_t2 = $this->nodeType) && !$_t2 instanceof Enum ? $_t2 === Xml::$Element : $_t2 == Xml::$Element) {
         $s .= "<";
         $s .= _hx_string_or_null($this->_nodeName);
         if (null == $this->_attributes) {
             throw new HException('null iterable');
         }
         $__hx__it = $this->_attributes->keys();
         while ($__hx__it->hasNext()) {
             $k = $__hx__it->next();
             $s .= " ";
             $s .= _hx_string_or_null($k);
             $s .= "=\"";
             $s .= _hx_string_or_null($this->_attributes->get($k));
             $s .= "\"";
         }
         if ($this->_children->length === 0) {
             $s .= "/>";
             return $s;
         }
         $s .= ">";
     } else {
         if (is_object($_t3 = $this->nodeType) && !$_t3 instanceof Enum ? $_t3 === Xml::$CData : $_t3 == Xml::$CData) {
             return "<![CDATA[" . _hx_string_or_null($this->_nodeValue) . "]]>";
         } else {
             if (is_object($_t4 = $this->nodeType) && !$_t4 instanceof Enum ? $_t4 === Xml::$Comment : $_t4 == Xml::$Comment) {
                 return "<!--" . _hx_string_or_null($this->_nodeValue) . "-->";
             } else {
                 if (is_object($_t5 = $this->nodeType) && !$_t5 instanceof Enum ? $_t5 === Xml::$DocType : $_t5 == Xml::$DocType) {
                     return "<!DOCTYPE " . _hx_string_or_null($this->_nodeValue) . ">";
                 } else {
                     if (is_object($_t6 = $this->nodeType) && !$_t6 instanceof Enum ? $_t6 === Xml::$ProcessingInstruction : $_t6 == Xml::$ProcessingInstruction) {
                         return "<?" . _hx_string_or_null($this->_nodeValue) . "?>";
                     }
                 }
             }
         }
     }
     if (null == $this) {
         throw new HException('null iterable');
     }
     $__hx__it = $this->iterator();
     while ($__hx__it->hasNext()) {
         $x = $__hx__it->next();
         $s .= _hx_string_or_null($x->toString());
     }
     if (is_object($_t3 = $this->nodeType) && !$_t3 instanceof Enum ? $_t3 === Xml::$Element : $_t3 == Xml::$Element) {
         $s .= "</";
         $s .= _hx_string_or_null($this->_nodeName);
         $s .= ">";
     }
     return $s;
 }