JAXLXmlStream::reset_parser PHP Method

reset_parser() public method

public reset_parser ( )
    public function reset_parser()
    {
        $this->parse_final(null);
        @xml_parser_free($this->parser);
        $this->parser = null;
        $this->init_parser();
    }

Usage Example

コード例 #1
0
ファイル: xmpp_stream.php プロジェクト: jaxl/JAXL
 public function wait_for_sasl_response($event, $args)
 {
     switch ($event) {
         case "stanza_cb":
             $stanza = $args[0];
             if ($stanza->name == 'failure' && $stanza->ns == XMPP::NS_SASL) {
                 $reason = $stanza->children[0]->name;
                 //JAXLLogger::debug("sasl failed with reason ".$reason."");
                 $this->handle_auth_failure($reason);
                 return "logged_out";
             } elseif ($stanza->name == 'challenge' && $stanza->ns == XMPP::NS_SASL) {
                 $challenge = $stanza->text;
                 $this->send_challenge_response($challenge);
                 return "wait_for_sasl_response";
             } elseif ($stanza->name == 'success' && $stanza->ns == XMPP::NS_SASL) {
                 $this->xml->reset_parser();
                 $this->send_start_stream($this->jid);
                 return "wait_for_stream_start";
             } else {
                 JAXLLogger::debug("got unhandled sasl response");
             }
             return "wait_for_sasl_response";
             break;
         default:
             JAXLLogger::debug("uncatched {$event}");
             return $this->handle_other($event, $args);
             //return array("wait_for_sasl_response", 0);
             break;
     }
 }