コード例 #1
0
ファイル: Parser.php プロジェクト: Hywan/moxl
 private function end($parser, $name)
 {
     $name = str_replace(':', '', $name);
     $this->depth--;
     if ($this->raw != false) {
         $this->handler[0] .= '</' . $name . '>';
     }
     if ($this->raw != false && $this->depth == $this->raw) {
         $this->raw = false;
     }
     if ($this->depth == 1) {
         /*$dom = new \DOMDocument('1.0', 'utf-8');
           $element = $dom->importNode(dom_import_simplexml($this->node), true);
           $dom->appendChild($element); 
           $debug = $dom->saveHTML();
           fwrite(STDERR, colorize($debug, 'blue')." : ".colorize('received', 'green')."\n");*/
         \Moxl\Xec\Handler::handle($this->node);
         unset($this->node);
     } elseif ($this->depth > 1 && $this->raw == false) {
         $this->handler = current($this->handler->xpath("parent::*"));
     }
 }
コード例 #2
0
ファイル: Handler.php プロジェクト: movim/moxl
 public static function handleNode($s, $sparent = false)
 {
     $name = $s->getName();
     $node = false;
     if ($s->items && $s->items->attributes()->node) {
         $node = (string) $s->items->attributes()->node;
     }
     $ns = '';
     foreach ($s->attributes() as $key => $value) {
         if ($key == 'xmlns' && $ns == '') {
             $ns = $value;
         } elseif ('xmlns:' === substr($key, 0, 6)) {
             $ns = $value;
         }
     }
     if ($node != false) {
         $hash = md5($name . $ns . $node);
         Utils::log('Handler : Searching a payload for "' . $name . ':' . $ns . ' [' . $node . ']", "' . $hash . '"');
         Handler::searchPayload($hash, $s, $sparent);
     }
     $hash = md5($name . $ns);
     Utils::log('Handler : Searching a payload for "' . $name . ':' . $ns . '", "' . $hash . '"');
     Handler::searchPayload($hash, $s, $sparent);
 }