Skip to content
Snippets Groups Projects
Commit b59986fc authored by Alexander Nitsche's avatar Alexander Nitsche Committed by Andreas Fernandez
Browse files

[BUGFIX] Support parsing of XML files larger than 10 MB

EXT:impexp may run into memory limits when converting XML to PHP
arrays, even before all PHP memory is used up, because libxml has a
specific limit of 10 MB. This limit can be turned off by using the
`XML_PARSE_HUGE` (libxml) or `LIBXML_PARSEHUGE` (PHP) option, but
only for the DOMDocument implementation of libxml, and not for the
current XmlParser implementation.

By replacing the XmlParser implementation with a DOMDocument
implementation, larger XML files can be parsed with lower peak memory
consumption as a side effect. For example, parsing a 4 MB dummy XML
file consumes

56.03 MB (memory) / 168.72 MB (memory peak)

with the XmlParser, while using DOMDocument reduces the consumption to

56.15 MB (memory) / 60.08 MB (memory peak).

Besides the replacing of the implementation, XML parsing has been moved
to separate classes (Typo3XmlSerializer / Typo3XmlParser), fully covered
by tests, and restructured to reduce the number of required parameters to
a minimum. The functional scope was not reduced in any way.

Resolves: #83580
Releases: main, 11.5
Change-Id: Ic3345d539f028d766b49d01096ec34a6190a6dfe
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78249


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent 75238554
Branches
Tags
No related merge requests found
Showing
with 2013 additions and 23 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment