41 $this->requiredPhpExtensions =
'xml';
50 $this->objXml = xml_parser_create();
51 xml_set_object($this->objXml, $this);
63 if (!is_resource($this->objXml)) {
64 throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(
'Unable to create XML parser.', 1342641009);
67 $previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE);
69 xml_parser_set_option($this->objXml, XML_OPTION_CASE_FOLDING, FALSE);
70 xml_parser_set_option($this->objXml, XML_OPTION_SKIP_WHITE, FALSE);
71 xml_parser_set_option($this->objXml, XML_OPTION_TARGET_ENCODING,
'utf-8');
72 xml_set_element_handler($this->objXml,
'startElement',
'endElement');
73 xml_set_character_data_handler($this->objXml,
'characterData');
74 if (!($fp = fopen($file,
'r'))) {
75 throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(sprintf(
'Unable to open file resource %s.', htmlspecialchars($file)), 1342641010);
77 while ($data = fread($fp, 4096)) {
78 if (!xml_parse($this->objXml, $data, feof($fp))) {
79 throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(sprintf(
'XML error %s in line %u of file resource %s.', xml_error_string(xml_get_error_code($this->objXml)), xml_get_current_line_number($this->objXml), htmlspecialchars($file)), 1342641011);
82 libxml_disable_entity_loader($previousValueOfEntityLoader);
83 xml_parser_free($this->objXml);
95 switch ($elementName) {
97 $this->element = $elementName;
112 switch ($elementName) {
118 $this->element = NULL;
133 if (isset($this->element)) {
134 switch ($this->element) {
136 $this->title = $data;
145 $this->country = $data;
148 $this->sponsorname = $data;
151 $this->sponsorlink = $data;
154 $this->sponsorlogo = $data;
startElement($parser, $elementName, $attrs)
characterData($parser, $data)
endElement($parser, $elementName)