[TYPO3-core] RFC: feature #2743
Wolfgang Klinger
wolfgang at stufenlos.net
Mon Mar 6 09:17:43 CET 2006
*hiya!*
On Fri, 03 Mar 2006, Ingmar Schlecht wrote the following:
> > + function substituteConstantsCallBack($matches) {
> > + return isset($this->flatSetup[$matches[1]]) ? $this->flatSetup[$matches[1]] : $matches[0];
> > + }
>
> ...but in your function there isn't. Will it have any consequences?
I saw that too, but couldn't think of a scenario where anybody uses
-------
SOMETHING.BLUBL = my constant's value
-------
but I added it now anyway as you suggested.
> IMHO it needs to be changed to
> > + return isset($this->flatSetup[$matches[1]]) && !is_array($this->flatSetup[$matches[1]]) ? $this->flatSetup[$matches[1]] : $matches[0];
ok
> One question before I give a +1: How is the speed improvement in numbers?
------------
0.399
0.231
with 4 constants
0.766
0.234
with 12 constants
------------
and so on, the time grows with the numbers of constants with the old
version (first line).
I'll take a second look at the other method in tsparser_ext, maybe it's
faster with several callback methods as "hkdennis2k" suggests, I moved
the switch into the callback method for my tests. Let's see...
bye
Wolfgang
More information about the TYPO3-team-core
mailing list