]> git.joonet.de Git - adminer.git/commitdiff
Display MySQL variables
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 16 Jun 2009 15:10:37 +0000 (15:10 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 16 Jun 2009 15:10:37 +0000 (15:10 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@712 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/include/connect.inc.php
adminer/index.php
adminer/lang/cs.inc.php
adminer/variables.inc.php [new file with mode: 0644]
changes.txt

index 331bbc2609edf5bd36267e7561d9a435ce2391b0..ef17bc8761130bc1bd6183309efeaf0e803ec23a 100644 (file)
@@ -8,6 +8,7 @@ function connect_error() {
                echo '<p><a href="' . htmlspecialchars($SELF) . 'database=">' . lang('Create new database') . "</a></p>\n";
                echo '<p><a href="' . htmlspecialchars($SELF) . 'privileges=">' . lang('Privileges') . "</a></p>\n";
                echo '<p><a href="' . htmlspecialchars($SELF) . 'processlist=">' . lang('Process list') . "</a></p>\n";
+               echo '<p><a href="' . htmlspecialchars($SELF) . 'variables=">' . lang('Variables') . "</a></p>\n";
                echo "<p>" . lang('MySQL version: %s through PHP extension %s', "<b" . ($dbh->server_info < 4.1 ? " class='binary'" : "") . ">$dbh->server_info</b>", "<b>$dbh->extension</b>") . "</p>\n";
                echo "<p>" . lang('Logged as: %s', "<b>" . htmlspecialchars($dbh->result($dbh->query("SELECT USER()"))) . "</b>") . "</p>\n";
        }
@@ -15,7 +16,7 @@ function connect_error() {
 }
 
 $dbh->query("SET SQL_QUOTE_SHOW_CREATE=1");
-if (!(strlen($_GET["db"]) ? $dbh->select_db($_GET["db"]) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]))) {
+if (!(strlen($_GET["db"]) ? $dbh->select_db($_GET["db"]) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]) || isset($_GET["variables"]))) {
        if (strlen($_GET["db"])) {
                unset($_SESSION["databases"][$_GET["server"]]);
        }
index d2e6a4ad73a4be459ca65cd3d90fa4a3ff2d015b..6153f314748f8059024331c4ce7bc74520d7080b 100644 (file)
@@ -126,6 +126,8 @@ if (isset($_GET["download"])) {
                        include "./processlist.inc.php";
                } elseif (isset($_GET["select"])) {
                        include "./select.inc.php";
+               } elseif (isset($_GET["variables"])) {
+                       include "./variables.inc.php";
                } else {
                        include "./db.inc.php";
                }
index 6127ae7f319577b2d3988224422abcce9e9b36bf..88607e28b3d213bf5a4f4b5dcda31e2374c872f8 100644 (file)
@@ -214,4 +214,5 @@ $translations = array(
        '(anywhere)' => '(kdekoliv)',
        '%.3f s' => '%.3f s',
        'History' => 'Historie',
+       'Variables' => 'Proměnné',
 );
diff --git a/adminer/variables.inc.php b/adminer/variables.inc.php
new file mode 100644 (file)
index 0000000..a089f77
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+page_header(lang('Variables'));
+
+echo "<table cellspacing='0'>\n";
+$result = $dbh->query("SHOW VARIABLES");
+while ($row = $result->fetch_assoc()) {
+       echo "<tr>";
+       echo "<th><code class='jush-sql_set'>" . htmlspecialchars($row["Variable_name"]) . "</code></th>";
+       echo "<td>" . (strlen(trim($row["Value"])) ? htmlspecialchars($row["Value"]) : "&nbsp;") . "</td>";
+       echo "</tr>\n";
+}
+$result->free();
+echo "</table>\n";
index 6733523719c97d731eb17c7f3ce04df0d9ec9bfd..99b3900865cc0448745940e5de9b8dc3080035b1 100644 (file)
@@ -5,6 +5,7 @@ Display execution time in SQL query
 Relative date and time functions
 Version checker
 Save queries to history and display it on SQL page
+Display MySQL variables
 Ability to select all rows on current page of select
 Separate JavaScript functions
 Always use the default style before the external one