From f4e0a1cd92f609ab9ea8bf63b532f860c4513cbe Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Tue, 16 Jun 2009 15:10:37 +0000 Subject: [PATCH] Display MySQL variables git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@712 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/include/connect.inc.php | 3 ++- adminer/index.php | 2 ++ adminer/lang/cs.inc.php | 1 + adminer/variables.inc.php | 13 +++++++++++++ changes.txt | 1 + 5 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 adminer/variables.inc.php diff --git a/adminer/include/connect.inc.php b/adminer/include/connect.inc.php index 331bbc26..ef17bc87 100644 --- a/adminer/include/connect.inc.php +++ b/adminer/include/connect.inc.php @@ -8,6 +8,7 @@ function connect_error() { echo '

' . lang('Create new database') . "

\n"; echo '

' . lang('Privileges') . "

\n"; echo '

' . lang('Process list') . "

\n"; + echo '

' . lang('Variables') . "

\n"; echo "

" . lang('MySQL version: %s through PHP extension %s', "server_info < 4.1 ? " class='binary'" : "") . ">$dbh->server_info", "$dbh->extension") . "

\n"; echo "

" . lang('Logged as: %s', "" . htmlspecialchars($dbh->result($dbh->query("SELECT USER()"))) . "") . "

\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"]]); } diff --git a/adminer/index.php b/adminer/index.php index d2e6a4ad..6153f314 100644 --- a/adminer/index.php +++ b/adminer/index.php @@ -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"; } diff --git a/adminer/lang/cs.inc.php b/adminer/lang/cs.inc.php index 6127ae7f..88607e28 100644 --- a/adminer/lang/cs.inc.php +++ b/adminer/lang/cs.inc.php @@ -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 index 00000000..a089f778 --- /dev/null +++ b/adminer/variables.inc.php @@ -0,0 +1,13 @@ +\n"; +$result = $dbh->query("SHOW VARIABLES"); +while ($row = $result->fetch_assoc()) { + echo ""; + echo "" . htmlspecialchars($row["Variable_name"]) . ""; + echo "" . (strlen(trim($row["Value"])) ? htmlspecialchars($row["Value"]) : " ") . ""; + echo "\n"; +} +$result->free(); +echo "\n"; diff --git a/changes.txt b/changes.txt index 67335237..99b39008 100644 --- a/changes.txt +++ b/changes.txt @@ -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