@@ 54-58 (lines=5) @@ | ||
51 | xml_set_object($parser, $this); |
|
52 | xml_set_element_handler($parser, "call_tag_open", "call_tag_close"); |
|
53 | xml_set_character_data_handler($parser, "call_tag_data"); |
|
54 | if (!xml_parse($parser, $string)) { |
|
55 | $this->error = sprintf("XML error: %s at line %d", |
|
56 | xml_error_string(xml_get_error_code($parser)), |
|
57 | xml_get_current_line_number($parser)); |
|
58 | } |
|
59 | } |
|
60 | ||
61 | public function _get_array($string, $MULTI_TAGS = array()) { |
|
@@ 71-75 (lines=5) @@ | ||
68 | xml_set_object($parser, $this); |
|
69 | xml_set_element_handler($parser, "startElement", "endElement"); |
|
70 | xml_set_character_data_handler($parser, "characterData"); |
|
71 | if (!xml_parse($parser, $string)) { |
|
72 | $this->error = sprintf("XML error: %s at line %d", |
|
73 | xml_error_string(xml_get_error_code($parser)), |
|
74 | xml_get_current_line_number($parser)); |
|
75 | } |
|
76 | ||
77 | return $this->elements; |
|
78 | } |
|
@@ 94-98 (lines=5) @@ | ||
91 | } else { |
|
92 | while (!$this->error && !feof($fp)) { |
|
93 | $string = fread($fp, 4096); |
|
94 | if (!xml_parse($parser, $string)) { |
|
95 | $this->error = sprintf("XML error: %s at line %d", |
|
96 | xml_error_string(xml_get_error_code($parser)), |
|
97 | xml_get_current_line_number($parser)); |
|
98 | } |
|
99 | } |
|
100 | fclose($fp); |
|
101 | } |
|
@@ 121-125 (lines=5) @@ | ||
118 | ||
119 | $string = curl_exec($ch); |
|
120 | curl_close($ch); |
|
121 | if (!xml_parse($parser, $string)) { |
|
122 | $this->error = sprintf("XML error: %s at line %d", |
|
123 | xml_error_string(xml_get_error_code($parser)), |
|
124 | xml_get_current_line_number($parser)); |
|
125 | } |
|
126 | ||
127 | } |
|
128 | } |