2010/7/20 Michal Čihař michal@cihar.com:
Hi
for several times I wondered why we use so many different ways to create format strings, let's take three examples:
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1';
where * %d will be replaced by the database name. * %t will be replaced by the table name. * %f will be replaced by a list of field names.
$cfg['Export']['file_template_table'] = '__TABLE__';
where __TABLE__, __DB__ and __SERVER__ are used
$cfg['TitleTable'] = '@HTTP_HOST@ / @VSERVER@ / @DATABASE@ / @TABLE@ | @PHPMYADMIN@';
where @HTTP_HOST@, @SERVER@, @VERBOSE@, @VSERVER@, @DATABASE@, @TABLE@ and @PHPMYADMIN@ can be used
How about making use just single way to do this and create common function which will do the formatting?
I'm somehow more inclined to use %x, however @SOMETHING@ is more self documenting, while __SOMETHING__ looks just too long to me.
I know this would be incompatible change, but it looks like we're making enough other big changes for next major version so that it won't be that big issue.
Looks good to me, +1 for @VARIABLE@ syntax for reasons you mentioned.
Maybe a list of incompatible changes (a short checklist) would help people migrate their settings to next major version.