]> git.nbdom.net Git - nb.git/commitdiff
www/dbq/dbq.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 13 Oct 2017 14:42:45 +0000 (15:42 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 13 Oct 2017 14:42:45 +0000 (15:42 +0100)
www/dbq/dbq.php

index 00cf269e66ed0333211035b37a6bcfc9db78ac55..629c9f0ae7fbce5a3e7b987fb8dde7a9ae4cfc33 100644 (file)
@@ -802,10 +802,10 @@ EOF;
         [ 'ssha512_password', 'Encrypt a password' ],
         [ 'logout', 'Clear Basic Auth' ],
         [ 'status', 'Status infos page' ],
+        [ 'json', 'Dump json infos' ],
       ] + (
         ($this->perm < self::ADMIN) ? [] :
       [
-        [ 'json', 'Dump json infos' ],
         [ 'phpinfo', 'Phpinfo datas' ],
         [ '_SERVER', 'Dumper _SERVER' ],
         [ '_REQUEST', 'Dumper _REQUEST' ],
@@ -847,12 +847,12 @@ EOF;
     } elseif ($action == 'status') {
       $this->page($this,'status');
 
-    } elseif ($this->perm < self::ADMIN) {
-      // NOW ONLY FOR ADMIN !
-
     } elseif ($action == 'json') {
       $this->page($this,'json');
 
+    } elseif ($this->perm < self::ADMIN) {
+      // NOW ONLY FOR ADMIN !
+
     } elseif ($action == 'phpinfo') {
       $this->rows_table($action,$this->phpinfo_rows());
       #$this->page(['phpinfo'=>$this->page->phpinfo(true)]);
@@ -888,6 +888,10 @@ EOF;
         [ 'help', 'This help' ],
         [ 'status', 'Database status' ],
         [ 'ls', 'List tables' ],
+        [ 'databases', 'List databases' ],
+        [ 'schema', 'Dump database structure only' ],
+        [ 'dump', 'Dump database structure with datas' ],
+        [ 'csv', 'Dump database data in csv with table name as first colum' ],
       ],['command','description'],function(&$r){
         $r['command'] = $this->page->tag('a',$r['command'],'href="'
           .$this->db->base.'/'.($r['command'] == self::PARAM_DB_DEFAULT
@@ -920,7 +924,7 @@ EOF;
       $this->db->dump2csv();
       exit;
 
-    } elseif ($action == 'sql') {
+    } elseif ($action == 'schema') {
       header('Content-type: text/plain');
       $this->db->sql();
       exit;