[TYPO3-v4] Using t3lib_div::getUrl() also for xml.gz files from Extension Manager?
Marcus Krause
marcus#exp2011 at t3sec.info
Mon Sep 19 13:05:11 CEST 2011
Hi!
François Suter schrieb am 09/19/2011 11:59 AM Uhr:
> Hi,
>
>> It's just the later processing of the *local* xml.z file that is making
>> troubles for Francois, because the current method makes
>> XMLReader::open() on a "compress.zlib://.../typo3temp/extensions.xml.Z"
>> file, while Francois proposes to make a $xmlContent = t3lib::getUrl() on
>> that first, and *then* pass the (uncompressed) xmlContent to XMLReader.
>
> Exactly, proxies wouldn't be an issue here. So maybe actually using
> file_get_contents() directly might be ok, but I don't know if it's part
> of the functions that may be blocked per PHP configuration (like fopen
> or fsockopen).
>
>> I have nothing against this, but it might be that it takes more memory
>> to do so, which should be considered (the uncompressed extensions.xml is
>> about 24M in size).
>
> I didn't think about that. It's true that it would take some additional
> memory. Maybe it's then worth testing if XMLReader::open() has been
> successful or not and call t3lib_div::getURL() as a fall back. It
> introduces an additional test, but I guess it's not an issue in this case.
Using compress.zlib allows us to work on streams. Such, we don't have
the complete 24MB file in memory. The parsers are also written in a way
to reduce memory and time consumption.
See benchmarks made during the parser rework:
http://forge.typo3.org/projects/typo3v4-em/wiki/Benchmarks
I think, if XMLReader::open() has problems in your specific environment,
it's either a bug in XMLReader (pull parser based on ext/xmlreader) and
to be addressed by PHP guys or prereqisites aren't met and *are not
tested for*.
Then we should provide a test for this and fallback to the other parser
(push parser based on ext/xml).
Marcus.
More information about the TYPO3-project-v4
mailing list