46 $this->requiredPhpExtensions =
'xml';
55 $this->objXml = xml_parser_create();
56 xml_set_object($this->objXml, $this);
68 if (!is_resource($this->objXml)) {
69 throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(
'Unable to create XML parser.', 1342640663);
72 $previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE);
74 xml_parser_set_option($this->objXml, XML_OPTION_CASE_FOLDING, FALSE);
75 xml_parser_set_option($this->objXml, XML_OPTION_SKIP_WHITE, FALSE);
76 xml_parser_set_option($this->objXml, XML_OPTION_TARGET_ENCODING,
'utf-8');
77 xml_set_element_handler($this->objXml,
'startElement',
'endElement');
78 xml_set_character_data_handler($this->objXml,
'characterData');
79 if (!($fp = fopen($file,
'r'))) {
80 throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(sprintf(
'Unable to open file resource %s.', htmlspecialchars($file)), 1342640689);
82 while ($data = fread($fp, 4096)) {
83 if (!xml_parse($this->objXml, $data, feof($fp))) {
84 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)), 1342640703);
87 libxml_disable_entity_loader($previousValueOfEntityLoader);
88 xml_parser_free($this->objXml);
100 switch ($elementName) {
102 $this->extensionKey = $attrs[
'extensionkey'];
105 $this->version = $attrs[
'version'];
108 $this->element = $elementName;
120 switch ($elementName) {
129 $this->element = NULL;
141 if (isset($this->element)) {
142 switch ($this->element) {
143 case 'downloadcounter':
146 if ($this->version == NULL) {
147 $this->extensionDownloadCounter = $data;
149 $this->versionDownloadCounter = $data;
153 $this->title = $data;
156 $this->description = $data;
159 $this->state = $data;
162 $this->reviewstate = $data;
165 $this->category = $data;
167 case 'lastuploaddate':
168 $this->lastuploaddate = $data;
170 case 'uploadcomment':
171 $this->uploadcomment = $data;
177 $this->authorname = $data;
180 $this->authoremail = $data;
182 case 'authorcompany':
183 $this->authorcompany = $data;
185 case 'ownerusername':
186 $this->ownerusername = $data;
189 $this->t3xfilemd5 = $data;
startElement($parser, $elementName, $attrs)
endElement($parser, $elementName)
characterData($parser, $data)
convertDependencies($dependencies)
resetProperties($resetAll=FALSE)