Project

General

Profile

Actions

Bug #54520

closed

joinTSarrays() is array_replace_recursive

Added by Michiel Roos over 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Performance
Target version:
Start date:
2013-12-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
no-brainer
Is Regression:
No
Sprint Focus:

Description

\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::joinTSarrays can be replaced by the PHP native array_replace_recursive().

array_replace_recursive() replaces the values of array1 with the same values from all the following arrays. If a key from the first array exists in the second array, its value will be replaced by the value from the second array. If the key exists in the second array, and not the first, it will be created in the first array. If a key only exists in the first array, it will be left as is. If several arrays are passed for replacement, they will be processed in order, the later array overwriting the previous values.

array_replace_recursive() is recursive : it will recurse into arrays and apply the same process to the inner value.

That is exactly what the joinTSarrays() does.

I think we should replace the calls with straight up array_replace_recursive() and deprecate joinTSarrays()

joinTSarrays() both overwrites the $conf values with anything in the $old_conf and also creates any elements not present in $conf with new values from $old_conf. So they are functionally identical.

Actions #1

Updated by Gerrit Code Review over 10 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26500

Actions #2

Updated by Gerrit Code Review over 10 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26500

Actions #3

Updated by Ernesto Baschny over 10 years ago

  • Status changed from Under Review to Resolved
  • Target version changed from next-patchlevel to 6.2.0
Actions #4

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF