Obmerk Kronen
Obmerk Kronen

Reputation: 15949

phpmyadmin export naming templates / variables

While exporting SQL from phpmyadmin these is an option to give the exported file some variables to be included in the name of the file itself ( and also save it like some sort of "template" under settings-->export) , for example :

__DB__ or @DATABASE@

@HTTPHOST@

@TABLE@ ( if exporting from a table )

@SERVER@ ( for IP )

@USER@ or __USER__ (not always...)

etc..

I also know of some time variables like

%F and the standard %Y,%M,%D, %m ,%s etc ( strftime ) ..

so for example @DATABASE@-@SERVER@-%F will give me a file name like :

dbname-127.0.0.1-2019-03-21.sql

I have searched for documentation on these, but could not find on the official phpmyadmin docs . I also noticed that they do not react the same on all servers .

My question is:

Are there any other variables - What is ( or where to find ) the complete list of documented variables and the correct usage format ( __x__ or @NAME@ ) ?

How ( or where ) are they set on a server / user basis - and can one set / enable / disable these on own server - or even add new ones ?

Upvotes: 0

Views: 2784

Answers (1)

Dave
Dave

Reputation: 5191

The __xx__ variables exist for backward compatibility when things like that were stored in cookies. From the code:

    /* Replacement mapping */
    /*
     * The __VAR__ ones are for backward compatibility, because user
     * might still have it in cookies.
     */
   $replace = array(
       '@HTTP_HOST@' => $vars['http_host'],
       '@SERVER@' => $vars['server_name'],
       '__SERVER__' => $vars['server_name'],
       '@VERBOSE@' => $vars['server_verbose'],
       '@VSERVER@' => $vars['server_verbose_or_name'],
       '@DATABASE@' => $vars['database'],
       '__DB__' => $vars['database'],
       '@TABLE@' => $vars['table'],
       '__TABLE__' => $vars['table'],
       '@PHPMYADMIN@' => $vars['phpmyadmin_version'])

Since there is no way to have a default set of export values for all users you could create a set for your users and store them in the pma__userconfig table in the phpmyadmin database. The values are stored in JSON format.

Upvotes: 1

Related Questions