From: stronk7 Date: Sat, 17 May 2003 08:56:53 +0000 (+0000) Subject: Debug a bit X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a4ad03f1752acc094409bd4939c7f572a35556b8;p=moodle.git Debug a bit --- diff --git a/backup/restore.php b/backup/restore.php index a3e32033ae..9b562d3464 100644 --- a/backup/restore.php +++ b/backup/restore.php @@ -1,5 +1,5 @@ shortname: $strcourserestore", $site->fullname, "admin/index.php\">$stradministration -> - $strcourserestore -> ".basename($file)); + $strcourserestore -> ".basename($file)); //Print form print_heading("$strcourserestore: ".basename($file)); diff --git a/backup/restorelib.php b/backup/restorelib.php index f5433b9056..d6c9c4577a 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -76,23 +76,21 @@ var $finished = false; //Flag to say xml_parse to stop function startElement($parser, $tagName, $attrs) { - $this->tree[$this->level] = $tagName; - //echo str_repeat(" ",$this->level*2)."<".$tagName.">
\n"; $this->level++; + $this->tree[$this->level] = $tagName; + echo $this->level.str_repeat(" ",$this->level*2)."<".$tagName.">
\n"; //Debug } function endElement($parser, $tagName) { - if (trim($this->content)) { - //echo utf8_decode(str_repeat(" ",$this->level*2).$this->content."
\n"); - } + if (trim($this->content)) //Debug + echo "C".utf8_decode(str_repeat(" ",($this->level+2)*2).$this->content."
\n"); //Debug + echo $this->level.str_repeat(" ",$this->level*2)."</".$tagName.">
\n"; //Debug $this->level--; - //echo str_repeat(" ",$this->level*2)."</".$tagName.">
\n"; $this->tree[$this->level] = ""; $this->content = ""; - //Stop parsing if todo = INFO and tagName = INFO + //Stop parsing if todo = INFO and tagName = INFO (en of the tag, of course) //Speed up a lot (avoid parse all) - //echo $tagName."
"; if (($this->todo == "INFO") and ($tagName == "INFO")) { $this->finished = true; } @@ -125,6 +123,10 @@ xml_get_current_line_number($xml_parser))); fclose($fp); } + //Get info from parser + $info = $moodle_parser->info; + + //Clear parser mem xml_parser_free($xml_parser); if ($Status) {