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

Simon Child simondt at gpuk.net
Sat Apr 22 01:56:00 CEST 2006


"Franz Koch" <typo3 at fx-graefix.de> wrote in message
news:mailman.1.1144424534.16387.typo3-dev at lists.netfielders.de...
> Dimitri Tarassenko schrieb:
> > Having spent some time today with the new EM code - there are a couple
> > of things I still don't understand.
> >
> > 1. If we still have some serialize()d data in the extensions.xml
> > metadata (dependencies), what's the point of having it as XML at all?
> > Why not serialize everything and forget the XML parsers altogether?
> >
> > 2. If the XML gets parsed and then converted into "extensions.bin",
> > "reviewstates.bin", etc., why can't we just download these pre-parsed
> > files from the repository?
>
> maybe that would solve the memory problems with the new EM on shared
> hosts that causes a 500 when trying to parse the data.

I've been struggling with trying to get the EM working on 4.0 and have been
looking at the same code, with similar thoughts.

This is the line that is crashing me:

$content .=
$this->xmlhandler->parseExtensionsXML(implode(gzfile(PATH_site.'typo3temp/ex
tensions.xml.gz')));

NB This is not a shared server, it is a dedicated server, mod_php 4.3.4 is
compiled --without-memory-limit
The OS is FreeBSD, not linux.

Breaking this up like this:

$temp1 = gzfile(PATH_site.'typo3temp/extensions.xml.gz');
$temp2 = implode($temp1);
$content .= $this->xmlhandler->parseExtensionsXML($temp2);

It seems that there is no problem with the first line even though
extensions.xml when unzipped is a nearly 6Mb file with about 89,000 lines. I
suppose a 6Mb array isn't too bad (though 89,000 elements??), but that line
processes OK.

The second line (implode) is where it crashes out.

I tried replacing lines 1 and 2 with this code, but it was no better:

   $temp1 = @gzopen(PATH_site.'typo3temp/extensions.xml.gz', 'rb');
   if ($temp1) {
       $temp2 = '';
       while (!gzeof($temp1)) {
           $temp2 .= gzread($temp1, 1024);
       }
       gzclose($temp1);
   }


Can anyone think of another/better way to load this extension data?

-- 
Simon Child






More information about the TYPO3-dev mailing list