[Phpmyadmin-devel] Inconsistent format strings
Piotr Przybylski
piotr.prz at gmail.com
Tue Jul 20 16:55:54 CEST 2010
2010/7/20 Michal Čihař <michal at 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.
--
Piotr Przybylski
More information about the Developers
mailing list