diff -r 7602d7fb60d9 -r 026da5437111 tools/profiler/php/ProfFileParser.class.php --- a/tools/profiler/php/ProfFileParser.class.php Fri Jul 11 06:51:21 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -report = FALSE; - $this->curtype = FALSE; - - if (($contents = file_get_contents($file)) === FALSE) - { - $this->last_error = 'File not found'; - return FALSE; - } - - $xml = xml_parser_create(); - xml_set_object($xml, $this); - xml_set_element_handler($xml, 'tag_open', 'tag_close'); - xml_parser_set_option($xml, XML_OPTION_CASE_FOLDING, false); - - if (!xml_parse($xml, $contents)) - { - $this->last_error = 'Line: ' . xml_get_current_line_number($xml) . ' -- ' . xml_error_string(xml_get_error_code($xml)); - return FALSE; - } - - return $this->report; - } - - public function tag_open($parser, $tag, $attrs) - { - if ($tag == 'profile') - { - $this->report = new ProfReport(); - $this->report->time = $attrs['time']; - $this->report->uptime = $attrs['uptime']; - } - else if ($tag == 'report') - { - $this->curtype = $attrs['name']; - } - else if ($tag == 'item') - { - if ($this->report === FALSE || $this->curtype === FALSE) - { - return; - } - $attrs['type'] = $this->curtype; - $this->report->items[] = $attrs; - } - } - - public function tag_close($parser, $tag) - { - if ($tag == 'report') - { - $this->curtype = FALSE; - } - } -} - -?>