[Phpmyadmin-devel] Inconsistent format strings

Michal Čihař michal at cihar.com
Tue Jul 20 15:27:58 CEST 2010


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.

-- 
	Michal Čihař | http://cihar.com | http://blog.cihar.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20100720/a3a449c4/attachment.sig>


More information about the Developers mailing list