[TYPO3-dev] EM, TER2, XML and other animals

Simon Child simondt at gpuk.net
Sat Apr 22 12:15:50 CEST 2006


"Dimitri Tarassenko" <mitka at mitka.us> wrote in message
news:mailman.6048.1145666846.29768.typo3-dev at lists.netfielders.de...

> Check if this:
>
> $a = implode(gzfile('extensions.xml.gz'));
> $b = implode(gzfile('extensions.xml.gz'));
> $c = implode(gzfile('extensions.xml.gz'));
> echo "Uncompressed sizes: ".strlen($a). ", ".strlen($b).", ".strlen($c).
"\n";
>
> crashes your PHP, because it does crash it on 1and1 servers.

Uncompressed sizes: 1515520, 1515520, 1515520

so it appears to work but the files are too small.


I tried the following and it appeared to work:

<?php
$a = implode(gzfile('extensions.xml.gz'));
print_r($a);
?>

but scrolling down to the bottom of the long page in fact it had only loaded
25% of the file in the browser (same in IE6 and firefox) and then it was
truncated in the middle of a word.

I tried doing the implode outside of php:

at command line:

gunzip extensions.xml.gz
perl -p -e 's/[\n\ ]//gm' extensions.xml > ex.xml

Then:

<?php
   $file = @fopen('ex.xml', 'rb');
   if ($file) {
       $data = '';
       while (!feof($file)) {
           $data .= fread($file, 1024);
       }
       fclose($file);
   }
print_r($data);
?>

and this does display the whole file


> I still wonder why does EM saves a string to file then does
> implode(gzfile()) when a simple gzinflate(substr(s,10)) would do the
> same with less memory required and no disk IO. But what the heck, if
> this was the only EM problem.

If extension.xml had no white space then there would be no need to read it
into an array and then implode it to a string, it could simply be read in
directly as above.

> Once you solve the gz-related problems it will start crashing in xml
parser.

Hmm, you're right :((((((

Anyone got a solution for that? I have some sites that I want to upgrade to
4.0, but until the EM works for me that is not really sensible. And it seems
that it is not only me in that position.



-- 
Simon Child






More information about the TYPO3-dev mailing list