2 namespace TYPO3\CMS\Extensionmanager\Utility\Parser;
34 $this->requiredPhpExtensions =
'xmlreader';
44 $this->objXml = new \XMLReader();
57 if (!(is_object($this->objXml) && get_class($this->objXml) ==
'XMLReader')) {
58 throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(
'Unable to create XML parser.', 1342640540);
60 if ($this->objXml->open($file,
'utf-8') ===
false) {
61 throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(sprintf(
'Unable to open file resource %s.', $file));
63 while ($this->objXml->read()) {
64 if ($this->objXml->nodeType == \XMLReader::ELEMENT) {
67 if ($this->objXml->nodeType == \XMLReader::END_ELEMENT) {
74 $this->objXml->close();
85 switch ($elementName) {
87 $this->extensionKey = $this->objXml->getAttribute(
'extensionkey');
90 $this->version = $this->objXml->getAttribute(
'version');
92 case 'downloadcounter':
95 if ($this->version == null) {
116 case 'lastuploaddate':
119 case 'uploadcomment':
131 case 'authorcompany':
134 case 'ownerusername':
151 switch ($elementName) {
175 if (!$this->objXml->isEmptyElement) {
177 while ($this->objXml->read()) {
178 if ($this->objXml->nodeType == \XMLReader::TEXT || $this->objXml->nodeType == \XMLReader::CDATA || $this->objXml->nodeType == \XMLReader::WHITESPACE || $this->objXml->nodeType == \XMLReader::SIGNIFICANT_WHITESPACE) {
179 $value .= $this->objXml->value;
181 if ($this->objXml->nodeType == \XMLReader::END_ELEMENT && $this->objXml->name === $elementName) {