Project

General

Profile

Actions

Feature #19495

closed

memory waste with locallang

Added by Franz Holzinger about 16 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Miscellaneous
Target version:
-
Start date:
2008-10-22
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.3
Tags:
Complexity:
Sprint Focus:

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

locallang.diff (886 Bytes) locallang.diff Administrator Admin, 2008-10-22 13:51
9622.patch (1.98 KB) 9622.patch Administrator Admin, 2010-05-06 03:59

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #27529: [TASK] Cleanup foreach() by using referencesClosed2011-06-18

Actions
Actions #1

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

Actions #2

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.

Actions #3

Updated by Benni Mack over 14 years ago

Hey Franz.

Let me know if the attached patch fixes your problem.

Actions #4

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

Actions #5

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.

Actions #6

Updated by Xavier Perseguers over 12 years ago

  • Status changed from Resolved to Closed
Actions #7

Updated by Ernesto Baschny over 11 years ago

  • Target version deleted (1281)
Actions

Also available in: Atom PDF