Categories > TBS next version >

php constant support

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: PasGlop
Date: 2005-01-24
Time: 18:36

php constant support

Hi,

I made a change to TBS 2.01 to make it support php constant. I didn't see any workaround for the moment.
Tell me if you find any reason not to use this code :

on line 881, add :
}elseif(defined($Value)){
$x = constant($Value);
$Value = &$x;
$x = &tbs_Misc_UnlinkVar('');
$SubId++;   

on line 1714 add :
}elseif(defined($Loc->SubLst[0])){
$Pos = $this->meth_Locator_Replace($Txt,$Loc,$Loc->SubLst[0],true);


TBS rocks.
By: Skrol29
Date: 2005-01-24
Time: 19:20

Re: php constant support

Hello PasGlop

TBS 2.01 is not announced to support constants.
It could be a good idea to make [var] fields recognize PHP constants, but it can also slow down the execution. This is because I've oberved that users like 'noerr' a lot, and this parameter is checked when no variable are found for the tag. It means that 'noerr'+(constant support) will cost an extra check. I will make some benches to see how much it cost.

But also, I've posted a Tip & Trick to make TBS merge constants with very few lines of Php.

Enjoy,
(Glop-Glop)