Closed sreekeshkamath closed 2 months ago
The XML_PARSE_HUGE
flag as option for DOMDocument::loadXML
can help here, but this could lead to problems on the consumer side, because it is not certain if a parser can process the huge file.
What do you put in a feed that is this big?
It's basically a feed produced by the client who's content exceeds 10 million characters, which is why we need to have XML_PARSH_HUGE
flag for loadXML()
. Can it be put as an optional argument in the package?
Can it be put as an optional argument in the package?
No, because a size of 10 MB for a feed does not correspond to a regular usage and possible problems on the consumer side.
But you can extend the relevant classes for your use case:
Then render the feed with your custom feed and entry classes:
$renderer = new MyCustom\Feed\Atom($feed);
$renderer->setType('atom');
$xml = $renderer->render()->saveXml();
Oh ok, thought it might have been a bug. Then the only solution would be to extend the class. Thanks anyways!
Bug Report
Summary
If data of more than 10 MB is passed to
setContent()
with<![CDATA[{$content}]]>
, we get CData section too big error.Please note that
CDATA
is still not being passed to thesetContent()
as mentioned here.Current behavior
Error is being thrown and execution stops at
loadXML()
located inWriter/Renderer/Entry/Atom.php
.How to reproduce
The following is in PHP:
While creating the feed, simply call the below function inside
setContent()
Expected behavior
XML should be generated for files larger than 10MB.