[Typo3-dev] XML vs. Serialized Arrays

Kraft Bernhard kraftb at kraftb.at
Thu Apr 7 21:47:21 CEST 2005


Ries van Twisk wrote:
> Bernard and others...
> 
> It saves me around 4 seconds of parsing time...
> It went down from around 9 seconds...depending on the page to around 4.3 
> seconds.... Amazing!

I wrote my modification in such a way that I write:

$ser = 'PHPARRAY:'.serialize($xmlAr);

when decoding I did:

if (substr($xml, 0, 9)=='PHPARRAY:') {
	$xmlAr = unserialize(substr($xml, 9));
} else {
	$xmlAr = t3lib_div::xml2array($xml);
}

So it is compatible to the old xml2array method. I did this because many functions
will use xml2array to read in DS structures from a file and this should still be posstible.


the array2xml method should look somehow like:

function array2xml($array, ... , $serializedArrayMode = $TYPO3_CONF_VARS['SYS']['whateverkey']?1:0);

so it would be possible to use the prefered method by changing a switch in the Install Tool ...


greets,
Bernhard




More information about the TYPO3-dev mailing list