Menu

Add database name to export file instead of server

Help
2016-06-28
2018-01-31
  • David Rahrer

    David Rahrer - 2016-06-28

    I'm trying to accomplish this by editing the dump-date plugin as it seemed most likely, but I can't seem to find a variable that will grab the database name from that being exported. Could anyone give me a push? Right now I just get localhost plus date. Thanks.

    class AdminerDumpDate {
    
        function dumpFilename($identifier) {
            $connection = connection();
            return friendly_url(($identifier != "" ? $identifier : (SERVER != "" ? SERVER : "localhost")) . "-" . $connection->result("SELECT NOW()"));
        }
    
    }
    

    Update:

    Ok, I was confused. As long as I have selected the database first and then go to export then it works fine without modification. I was effectively selecting server export and then unchecking all but one database, so it was naming the file as if it was a server dump. This seems to be a nonissue, sorry.

     

    Last edit: David Rahrer 2016-06-28
  • Jakub Vrána

    Jakub Vrána - 2018-01-31

    For posterity, Adminer stores the database name in the DB constant. It's also available in $_GET['db'].

     

Log in to post a comment.