[TYPO3-core] RFC #10565: Speedup / Cleanup t3lib_match_condition - make use of trimExplode
Benjamin Mack
benni at typo3.org
Sat Feb 28 12:49:20 CET 2009
Hey Steffen,
thanks for the review.
First of all, the following code glues an existing array together! It
does not split it! (which would be explode).
$userTS = implode($TSdataArray, chr(10).'[GLOBAL]'.chr(10));
$userTS = implode(chr(10) . '[GLOBAL]' . chr(10), $TSdataArray);
====
And then: This is no functional change. Please read
http://de.php.net/manual/en/function.implode.php
"Note: implode() can, for historical reasons, accept its parameters in
either order. For consistency with explode(), however, it may be less
confusing to use the documented order of arguments."
====
All the best,
Benni.
On 28.02.2009 12:21 Uhr, Steffen Kamper wrote:
> Hi Benni,
>
> great, this makes code much better readable, and the right methods are
> used.
>
> I have one concern with the very first chunk
>
> $userTS = implode(chr(10) . '[GLOBAL]' . chr(10), $TSdataArray);
>
> This won't work if userTS starts with "[GLOBAL]" - what is the reason
> here for your change? IIRC the statement GLOBAL is added in general.
>
> The rest is fine by reading and i will test it in the afternoon to give
> the final +1
>
> vg Steffen
>
> Benjamin Mack schrieb:
>> Hey all,
>>
>> Patch type: cleanup
>>
>> BT reference: http://bugs.typo3.org/view.php?id=10565
>>
>> Branches: trunk only
>>
>> Problem: Although we have a good API for trimming and exploding, we
>> don't make use of it in t3lib_match_condition.
>>
>> This cleanup is a bigger result of splitting the "tsconfig condition"
>> patch into cleanup and functional changes. While extracting these
>> changes, I added some more cleanups.
>>
>>
>> Solution: Change some checks, loops and functions to faster functions
>> and loops, add some whitespaces.
>>
>> And thus: Request for comments!
>>
>> Once this one is in the core, I will start working on the tsconfig
>> condition patch Olly and Bernhard prepared 1.5 years ago.
>>
>> All the best,
>> Benni.
>>
More information about the TYPO3-team-core
mailing list