Feature #19495
closedmemory waste with locallang
0%
Description
If you load a locallang in an extension into the $LOCAL_LANG, then you can see, when no utf8 is used, that all default texts have been stored twice in memory. The normal texts have wrongly be used also as keys. This is a big waste of memory for big locallang.xml files.
Example:
$LOCAL_LANG Pos2
Array (4) default
String (24) mark_memo_dam_goto Go to the DAM memo list.
String (17) mark_basket_goto Go to the basket.
String (24) Go to the DAM memo list. Go to the DAM memo list.
String (17) Go to the basket. Go to the basket.
Array (2) de
String (24) mark_memo_dam_goto Gehe zur DAM Memo Liste.
String (19) mark_basket_goto Gehe zum Warenkorb.
(issue imported from #M9622)
Files
Updated by Oliver Hader about 16 years ago
Hi Franz,
did you test/profile this? Current there's a reference "&$labelValue" used that points to the accordant array item.
Could please explain, what your "$LOCAL_LANG Pos2" example above shows us? Thanks!
olly
Updated by Franz Holzinger about 16 years ago
Hello Olly,
this example shows the debug output of the total read in locallang.xml file. This is the result returned from the function readLLXMLfile which has been called from tx_div2007_alpha::loadLL_fh001($pibaseObj,'EXT:'.TT_PRODUCTS_EXTkey.'/pi_search/locallang.xml');
which itself calls
$tempLOCAL_LANG = t3lib_div::readLLfile($basePath,$langObj->LLkey);
You can see that the default part has read in everything twice. One is too much and also useless.
Franz
in TYPO3 4.2.2 you have had:
if (is_array($LOCAL_LANG[$langKey]) && $targetCharset!='utf-8') {
foreach($LOCAL_LANG[$langKey] as $labelKey => $labelValue) {
$LOCAL_LANG[$langKey][$labelKey] = $csConvObj->utf8_decode($labelValue,$targetCharset);
}
}
which seems to be ok.
Updated by Benni Mack over 14 years ago
Hey Franz.
Let me know if the attached patch fixes your problem.
Updated by Stefan Neufeind over 13 years ago
Not sure if this actually "resolves" something (which I doubt). So I didn't reference this bug in the "Resolves"-line.
But using references for foreach()-values is a nice cleanup anyway.
Idea used in cleanup at: http://review.typo3.org/2791
Updated by Christian Kuhn over 13 years ago
- Category set to Miscellaneous
- Status changed from Needs Feedback to Resolved
- Target version changed from 0 to 1281
- TYPO3 Version changed from 4.3 to 4.6
- PHP Version changed from 5.2 to 5.3
Resolved
Since there was no feedback for quite some time and the real problem not described pretty well, I'll close this issue.
We've however created a new issue for the foreach() reference thing with #27529.
Updated by Xavier Perseguers over 12 years ago
- Status changed from Resolved to Closed