]> git.joonet.de Git - adminer.git/commitdiff
Rename $driver to $jush
authorJakub Vrana <jakub@vrana.cz>
Fri, 7 May 2010 13:44:22 +0000 (15:44 +0200)
committerJakub Vrana <jakub@vrana.cz>
Fri, 7 May 2010 13:44:22 +0000 (15:44 +0200)
19 files changed:
adminer/call.inc.php
adminer/database.inc.php
adminer/db.inc.php
adminer/drivers/mssql.inc.php
adminer/drivers/mysql.inc.php
adminer/drivers/pgsql.inc.php
adminer/drivers/sqlite.inc.php
adminer/dump.inc.php
adminer/foreign.inc.php
adminer/include/adminer.inc.php
adminer/include/auth.inc.php
adminer/include/export.inc.php
adminer/include/functions.inc.php
adminer/select.inc.php
adminer/sql.inc.php
adminer/table.inc.php
adminer/trigger.inc.php
adminer/variables.inc.php
compile.php

index 2e449523d22b0915fd36026b43e1683e71ec8e96..5c1ba945351ae9ae61ff0f65383b1a0fb801c647 100644 (file)
@@ -29,7 +29,7 @@ if (!$error && $_POST) {
                $call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val);
        }
        $query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . idf_escape($PROCEDURE) . "(" . implode(", ", $call) . ")";
-       echo "<p><code class='jush-$driver'>" . h($query) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
+       echo "<p><code class='jush-$jush'>" . h($query) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
        if (!$connection->multi_query($query)) {
                echo "<p class='error'>" . error() . "\n";
        } else {
index 0761609e09091a46389404339fc5d8bd297967ad..1ce45531d68ec50ff2bcf178a9a11634033089fa 100644 (file)
@@ -40,7 +40,7 @@ if ($_POST) {
        $collate = $_POST["collation"];
 } elseif (DB != "") {
        $collate = db_collation(DB, $collations);
-} elseif ($driver == "sql") {
+} elseif ($jush == "sql") {
        // propose database name with limited privileges
        foreach (get_vals("SHOW GRANTS") as $grant) {
                if (preg_match('~ ON (`(([^\\\\`]|``|\\\\.)*)%`\\.\\*)?~', $grant, $match) && $match[1]) {
index 131514d4cff3f5a80d53b500b50ecbabb0adc931..41fbc3bc5da45c304507678f360fd3add03e87ae 100644 (file)
@@ -4,7 +4,7 @@ $tables_views = array_merge((array) $_POST["tables"], (array) $_POST["views"]);
 if ($tables_views && !$error && !$_POST["search"]) {
        $result = true;
        $message = "";
-       if ($driver == "sql" && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"])) {
+       if ($jush == "sql" && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"])) {
                queries("SET foreign_key_checks = 0"); // allows to truncate or drop several tables at once
        }
        if ($_POST["truncate"]) {
@@ -75,9 +75,9 @@ if ($_GET["ns"] !== "") {
                }
                echo "</table>\n";
                if (!information_schema(DB)) {
-                       echo "<p><input type='hidden' name='token' value='$token'>" . ($driver == "sql" ? "<input type='submit' value='" . lang('Analyze') . "'> <input type='submit' name='optimize' value='" . lang('Optimize') . "'> <input type='submit' name='check' value='" . lang('Check') . "'> <input type='submit' name='repair' value='" . lang('Repair') . "'> " : "") . "<input type='submit' name='truncate' value='" . lang('Truncate') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /tables/) + ')');\"> <input type='submit' name='drop' value='" . lang('Drop') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /tables|views/) + ')');\">\n";
+                       echo "<p><input type='hidden' name='token' value='$token'>" . ($jush == "sql" ? "<input type='submit' value='" . lang('Analyze') . "'> <input type='submit' name='optimize' value='" . lang('Optimize') . "'> <input type='submit' name='check' value='" . lang('Check') . "'> <input type='submit' name='repair' value='" . lang('Repair') . "'> " : "") . "<input type='submit' name='truncate' value='" . lang('Truncate') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /tables/) + ')');\"> <input type='submit' name='drop' value='" . lang('Drop') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /tables|views/) + ')');\">\n";
                        $dbs = (support("scheme") ? schemas() : get_databases());
-                       if (count($dbs) != 1 && $driver != "sqlite") {
+                       if (count($dbs) != 1 && $jush != "sqlite") {
                                $db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB));
                                echo "<p>" . lang('Move to other database') . ($dbs ? ": " . html_select("target", $dbs, $db) : ': <input name="target" value="' . h($db) . '">') . " <input type='submit' name='move' value='" . lang('Move') . "'>\n";
                        }
index c5e6933e9af1d7f072c85e296169117acf56bf50..301c24b5083c4b9eb68f6411ed593823e59912fe 100644 (file)
@@ -493,7 +493,7 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . $connection->quote($table)
                return ereg('^(trigger|drop_col)$', $feature); //! view|routine|scheme|
        }
        
-       $driver = "mssql";
+       $jush = "mssql";
        $types = array();
        $structured_types = array();
        foreach (array(
index 928332b50ac9443a18d053c8df2496c83e65ff2c..54dbf623b1ce2fbd4c5c1b832f4664459d580947 100644 (file)
@@ -849,7 +849,7 @@ if (!defined("DRIVER")) {
                return !ereg("scheme|sequence" . ($connection->server_info < 5.1 ? "|event|partitioning" . ($connection->server_info < 5 ? "|view|routine|trigger" : "") : ""), $feature);
        }
 
-       $driver = "sql"; ///< @var string JUSH identifier
+       $jush = "sql"; ///< @var string JUSH identifier
        $types = array(); ///< @var array ($type => $maximum_unsigned_length, ...)
        $structured_types = array(); ///< @var array ($description => array($type, ...), ...)
        foreach (array(
index 63c6994772f9adf84899b86b5497edeb10e6df09..00e8c41f0f6ce694944844e5f15bcac5a43e6011 100644 (file)
@@ -492,7 +492,7 @@ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . $connection->qu
                return ereg('^(comment|view|scheme|sequence|trigger|variables|drop_col)$', $feature); //! routine|
        }
        
-       $driver = "pgsql";
+       $jush = "pgsql";
        $types = array();
        $structured_types = array();
        foreach (array( //! arrays
index 06186bc8720e9d6a68c7c1531145bd7fb882a54f..5ad855005c2ff26acb397f1bdc3301521f8e5a29 100644 (file)
@@ -549,7 +549,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
                return ereg('^(view|trigger|variables|status)$', $feature);
        }
        
-       $driver = "sqlite";
+       $jush = "sqlite";
        $types = array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0);
        $structured_types = array_keys($types);
        $unsigned = array();
index 22d6680716f1d97f9923c01ac9d2aa3808ae9871..17d147734d3990be6e57524ae5d9b093d9e527bf 100644 (file)
@@ -11,7 +11,7 @@ if ($_POST) {
        if ($_POST["format"] == "sql") {
                echo "-- Adminer $VERSION " . $drivers[DRIVER] . " dump
 
-" . ($driver != "sql" ? "" : "SET NAMES utf8;
+" . ($jush != "sql" ? "" : "SET NAMES utf8;
 SET foreign_key_checks = 0;
 SET time_zone = " . $connection->quote($connection->result("SELECT @@time_zone")) . ";
 SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
@@ -158,7 +158,7 @@ page_header(lang('Export'), "", ($_GET["export"] != "" ? array("table" => $_GET[
 $db_style = array('', 'USE', 'DROP+CREATE', 'CREATE');
 $table_style = array('', 'DROP+CREATE', 'CREATE');
 $data_style = array('', 'TRUNCATE+INSERT', 'INSERT', 'INSERT+UPDATE');
-if ($driver == "sql") {
+if ($jush == "sql") {
        $db_style[] = 'CREATE+ALTER';
        $table_style[] = 'CREATE+ALTER';
 }
index 200d3a03d40a8cb500ade86ca65114148e167701..4c01e4fef83f6e965981ca55a6c7c092fa9be312 100644 (file)
@@ -2,7 +2,7 @@
 $TABLE = $_GET["foreign"];
 if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change-js"]) {
        if ($_POST["drop"]) {
-               query_redirect("ALTER TABLE " . idf_escape($TABLE) . "\nDROP " . ($driver == "sql" ? "FOREIGN KEY " : "CONSTRAINT ") . idf_escape($_GET["name"]), ME . "table=" . urlencode($TABLE), lang('Foreign key has been dropped.'));
+               query_redirect("ALTER TABLE " . idf_escape($TABLE) . "\nDROP " . ($jush == "sql" ? "FOREIGN KEY " : "CONSTRAINT ") . idf_escape($_GET["name"]), ME . "table=" . urlencode($TABLE), lang('Foreign key has been dropped.'));
        } else {
                $source = array_filter($_POST["source"], 'strlen');
                ksort($source); // enforce input order
index c8d23cc4a2fcdb8c935598aa9ff51d331072086d..90f173680198b14e981681f592ddf37e5067e886 100644 (file)
@@ -122,8 +122,8 @@ document.getElementById('username').focus();
        * @return string
        */
        function selectQuery($query) {
-               global $driver;
-               return "<p><code class='jush-$driver'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
+               global $jush;
+               return "<p><code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
        }
        
        /** Description of a row in a table
@@ -383,12 +383,12 @@ document.getElementById('username').focus();
        * @return string
        */
        function messageQuery($query) {
-               global $driver;
+               global $jush;
                restart_session();
                $id = "sql-" . count($_SESSION["messages"]);
                $history = &get_session("history");
                $history[DB][] = (strlen($query) > 1e6 ? ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..." : $query); // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
-               return " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre class='jush-$driver'>" . shorten_utf8($query, 1000) . '</pre><p><a href="' . h(ME . 'sql=&history=' . (count($history[DB]) - 1)) . '">' . lang('Edit') . '</a></div>';
+               return " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre class='jush-$jush'>" . shorten_utf8($query, 1000) . '</pre><p><a href="' . h(ME . 'sql=&history=' . (count($history[DB]) - 1)) . '">' . lang('Edit') . '</a></div>';
        }
        
        /** Functions displayed in edit form
@@ -481,7 +481,7 @@ document.getElementById('username').focus();
        * @return null
        */
        function navigation($missing) {
-               global $VERSION, $connection, $token, $driver, $drivers;
+               global $VERSION, $connection, $token, $jush, $drivers;
                ?>
 <h1>
 <a href="http://www.adminer.org/" id="h1"><?php echo $this->name(); ?></a>
@@ -491,7 +491,7 @@ document.getElementById('username').focus();
 <?php
                if ($missing == "auth") {
                        $first = true;
-                       foreach ((array) $_SESSION["passwords"] as $key => $servers) { // $driver is global variable
+                       foreach ((array) $_SESSION["passwords"] as $driver => $servers) {
                                foreach ($servers as $server => $usernames) {
                                        foreach ($usernames as $username => $password) {
                                                if (isset($password)) {
@@ -499,7 +499,7 @@ document.getElementById('username').focus();
                                                                echo "<p>\n";
                                                                $first = false;
                                                        }
-                                                       echo "<a href='" . h(auth_url($key, $server, $username)) . "'>($drivers[$key]) " . h($username . ($server != "" ? "@$server" : "")) . "</a><br>\n";
+                                                       echo "<a href='" . h(auth_url($driver, $server, $username)) . "'>($drivers[$driver]) " . h($username . ($server != "" ? "@$server" : "")) . "</a><br>\n";
                                                }
                                        }
                                }
@@ -539,9 +539,9 @@ document.getElementById('username').focus();
                                                        $links[] = preg_quote($table, '/');
                                                }
                                                echo "<script type='text/javascript'>\n";
-                                               echo "var jushLinks = { $driver: [ '" . addcslashes(h(ME), "\\'/") . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
+                                               echo "var jushLinks = { $jush: [ '" . addcslashes(h(ME), "\\'/") . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
                                                foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
-                                                       echo "jushLinks.$val = jushLinks.$driver;\n";
+                                                       echo "jushLinks.$val = jushLinks.$jush;\n";
                                                }
                                                echo "</script>\n";
                                        }
index 2559325781baf7d714a2a3818cc53fb0dbeb48f8..4ffb42cb0e7ec8f6cf33c43da379b592bc1246a2 100644 (file)
@@ -43,8 +43,8 @@ if (isset($_POST["server"])) {
                redirect(substr(preg_replace('~(username|db|ns)=[^&]*&~', '', ME), 0, -1), lang('Logout successful.'));
        }
 } elseif ($_COOKIE["adminer_permanent"]) {
-       list($server, $username, $cipher, $system) = array_map('base64_decode', explode(":", $_COOKIE["adminer_permanent"])); // $driver is a global variable
-       if ($server == SERVER && $username === $_GET["username"] && $system == DRIVER) {
+       list($server, $username, $cipher, $driver) = array_map('base64_decode', explode(":", $_COOKIE["adminer_permanent"]));
+       if ($server == SERVER && $username === $_GET["username"] && $driver == DRIVER) {
                session_regenerate_id(); // defense against session fixation
                set_session("passwords", decrypt_string($cipher, $adminer->permanentLogin()));
        }
index 6cfa41a8368c61237a5442c7c3409cd9f235f5d1..892dce53882b931b25c182140b74d9aaa2ecdcd8 100644 (file)
@@ -100,8 +100,8 @@ DROP PROCEDURE adminer_alter;
 }
 
 function dump_data($table, $style, $select = "") {
-       global $connection, $driver;
-       $max_packet = ($driver == "sqlite" ? 0 : 1048576); // default, minimum is 1024
+       global $connection, $jush;
+       $max_packet = ($jush == "sqlite" ? 0 : 1048576); // default, minimum is 1024
        if ($style) {
                if ($_POST["format"] == "sql" && $style == "TRUNCATE+INSERT") {
                        echo "TRUNCATE " . idf_escape($table) . ";\n";
index 818121a013f66627319326a621499c6809ab885a..1441d30f42a26a109dc41d6507315b4f1cf3b477 100644 (file)
@@ -517,7 +517,7 @@ function enum_input($type, $name, $field, $value) {
 * @return null
 */
 function input($field, $value, $function) {
-       global $types, $adminer, $driver;
+       global $types, $adminer, $jush;
        $name = h(bracket_escape($field["field"]));
        echo "<td class='function'>";
        $functions = (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
@@ -549,7 +549,7 @@ function input($field, $value, $function) {
                } elseif (ereg('binary|blob|bytea', $field["type"]) && ini_bool("file_uploads")) {
                        echo "<input type='file' name='fields-$name'$onchange>";
                } elseif (ereg('text|blob', $field["type"])) {
-                       echo "<textarea " . ($driver != "sqlite" || ereg("\n", $value) ? "cols='50' rows='12'" : "cols='30' rows='1' style='height: 1.2em;'") . "$attrs>" . h($value) . '</textarea>'; // 1.2em - line-height
+                       echo "<textarea " . ($jush != "sqlite" || ereg("\n", $value) ? "cols='50' rows='12'" : "cols='30' rows='1' style='height: 1.2em;'") . "$attrs>" . h($value) . '</textarea>'; // 1.2em - line-height
                } else {
                        // int(3) is only a display hint
                        $maxlength = (!ereg('int', $field["type"]) && preg_match('~^([0-9]+)(,([0-9]+))?$~', $field["length"], $match) ? ($match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
index eb3ce95b43ff6677a70a6bdb1c8bf28146936972..a6c74bb3e7ac1dde45179e83181884be16deee68 100644 (file)
@@ -198,14 +198,14 @@ if (!$columns) {
                $page = floor(($found_rows - 1) / $limit);
        }
 
-       $query = "SELECT" . limit((intval($limit) && $group && count($group) < count($select) && $driver == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . $from . $group_by, ($limit != "" ? intval($limit) : null), ($page ? $limit * $page : 0), "\n");
+       $query = "SELECT" . limit((intval($limit) && $group && count($group) < count($select) && $jush == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . $from . $group_by, ($limit != "" ? intval($limit) : null), ($page ? $limit * $page : 0), "\n");
        echo $adminer->selectQuery($query);
        
        $result = $connection->query($query);
        if (!$result) {
                echo "<p class='error'>" . error() . "\n";
        } else {
-               if ($driver == "mssql") {
+               if ($jush == "mssql") {
                        $result->seek($limit * $page);
                }
                $email_fields = array();
@@ -217,7 +217,7 @@ if (!$columns) {
                // use count($rows) without LIMIT, COUNT(*) without grouping, FOUND_ROWS otherwise (slowest)
                if ($_GET["page"] != "last") {
                        $found_rows = (intval($limit) && $group && count($group) < count($select)
-                               ? ($driver == "sql" ? $connection->result(" SELECT FOUND_ROWS()") : $connection->result("SELECT COUNT(*) FROM ($query) x")) // space to allow mysql.trace_mode
+                               ? ($jush == "sql" ? $connection->result(" SELECT FOUND_ROWS()") : $connection->result("SELECT COUNT(*) FROM ($query) x")) // space to allow mysql.trace_mode
                                : count($rows)
                        );
                }
index c8b1232cb6216db9fc63a182a19301aff5e8687a..dc8eb49a21d1b626d5ae0465435f12d91fbca901 100644 (file)
@@ -59,7 +59,7 @@ if (!$error && $_POST) {
                                                $empty = false;
                                                $q = substr($query, 0, $match[0][1]);
                                                $queries++;
-                                               echo "<pre class='jush-$driver' id='sql-$queries'>" . shorten_utf8(trim($q), 1000) . "</pre>\n";
+                                               echo "<pre class='jush-$jush' id='sql-$queries'>" . shorten_utf8(trim($q), 1000) . "</pre>\n";
                                                ob_flush();
                                                flush(); // can take a long time - show the running query
                                                $start = explode(" ", microtime()); // microtime(true) is available since PHP 5
@@ -167,7 +167,7 @@ if ($history) {
        print_fieldset("history", lang('History'), $_GET["history"] != "");
        foreach ($history as $key => $val) {
                //! save and display timestamp
-               echo '<a href="' . h(ME . "sql=&history=$key") . '">' . lang('Edit') . "</a> <code class='jush-$driver'>" . shorten_utf8(ltrim(str_replace("\n", " ", str_replace("\r", "", preg_replace('~^(#|-- ).*~m', '', $val)))), 80, "</code>") . "<br>\n";
+               echo '<a href="' . h(ME . "sql=&history=$key") . '">' . lang('Edit') . "</a> <code class='jush-$jush'>" . shorten_utf8(ltrim(str_replace("\n", " ", str_replace("\r", "", preg_replace('~^(#|-- ).*~m', '', $val)))), 80, "</code>") . "<br>\n";
        }
        echo "<input type='submit' name='clear' value='" . lang('Clear') . "'>\n";
        echo "</div></fieldset>\n";
index a99e31e74e26a3b3fdc6dfa307971ba45daaf96d..f1d4f3d8ad51671cc112d9710006220b3263474f 100644 (file)
@@ -42,7 +42,7 @@ if ($fields) {
                        $foreign_keys = foreign_keys($TABLE);
                        if ($foreign_keys) {
                                echo "<table cellspacing='0'>\n";
-                               echo "<thead><tr><th>" . lang('Source') . "<td>" . lang('Target') . "<td>" . lang('ON DELETE') . "<td>" . lang('ON UPDATE') . ($driver != "sqlite" ? "<td>&nbsp;" : "") . "</thead>\n";
+                               echo "<thead><tr><th>" . lang('Source') . "<td>" . lang('Target') . "<td>" . lang('ON DELETE') . "<td>" . lang('ON UPDATE') . ($jush != "sqlite" ? "<td>&nbsp;" : "") . "</thead>\n";
                                foreach ($foreign_keys as $name => $foreign_key) {
                                        $link = ($foreign_key["db"] != "" ? "<strong>" . h($foreign_key["db"]) . "</strong>." : "") . h($foreign_key["table"]);
                                        echo "<tr>";
@@ -51,13 +51,13 @@ if ($fields) {
                                        echo "(<em>" . implode("</em>, <em>", array_map('h', $foreign_key["target"])) . "</em>)";
                                        echo "<td>$foreign_key[on_delete]\n";
                                        echo "<td>$foreign_key[on_update]\n";
-                                       if ($driver != "sqlite") {
+                                       if ($jush != "sqlite") {
                                                echo '<td><a href="' . h(ME . 'foreign=' . urlencode($TABLE) . '&name=' . urlencode($name)) . '">' . lang('Alter') . '</a>';
                                        }
                                }
                                echo "</table>\n";
                        }
-                       if ($driver != "sqlite") {
+                       if ($jush != "sqlite") {
                                echo '<p><a href="' . h(ME) . 'foreign=' . urlencode($TABLE) . '">' . lang('Add foreign key') . "</a>\n";
                        }
                }
index 3855758a61699570d965a8f2cf921b3c24276160..3915f39e99e4b39256fa5a7d51a3193932ec8cbe 100644 (file)
@@ -8,8 +8,8 @@ if ($_POST && !$error && in_array($_POST["Timing"], $trigger_options["Timing"])
        $timing_event = " $_POST[Timing] $_POST[Event]";
        $on = " ON " . idf_escape($TABLE);
        $dropped = drop_create(
-               "DROP TRIGGER " . idf_escape($_GET["name"]) . ($driver == "pgsql" ? " ON " . idf_escape($TABLE) : ""),
-               "CREATE TRIGGER " . idf_escape($_POST["Trigger"]) . ($driver == "mssql" ? $on . $timing_event : $timing_event . $on) . " $_POST[Type]\n$_POST[Statement]",
+               "DROP TRIGGER " . idf_escape($_GET["name"]) . ($jush == "pgsql" ? " ON " . idf_escape($TABLE) : ""),
+               "CREATE TRIGGER " . idf_escape($_POST["Trigger"]) . ($jush == "mssql" ? $on . $timing_event : $timing_event . $on) . " $_POST[Type]\n$_POST[Statement]",
                ME . "table=" . urlencode($TABLE),
                lang('Trigger has been dropped.'),
                lang('Trigger has been altered.'),
index 3c117024893fb477b5682c2a3b83111ffa1c5bb9..901109e0c173df534e47e075e6b977c4e30f997e 100644 (file)
@@ -9,7 +9,7 @@ if (!$variables) {
        echo "<table cellspacing='0'>\n";
        foreach ($variables as $key => $val) {
                echo "<tr>";
-               echo "<th><code class='jush-" . $driver . ($status ? "status" : "set") . "'>" . h($key) . "</code>";
+               echo "<th><code class='jush-" . $jush . ($status ? "status" : "set") . "'>" . h($key) . "</code>";
                echo "<td>" . nbsp($val);
        }
        echo "</table>\n";
index ff48cba159f50bd3dd430a0de137e9208cee58ba..c112d8aa90952acaf89a1cd529282cfe7bc2b39e 100644 (file)
@@ -173,9 +173,9 @@ function compile_file($match) {
        return call_user_func($match[2], file_get_contents(dirname(__FILE__) . "/$project/$match[1]"));
 }
 
-$DRIVER = "";
+$driver = "";
 if (file_exists(dirname(__FILE__) . "/adminer/drivers/" . $_SERVER["argv"][1] . ".inc.php")) {
-       $DRIVER = $_SERVER["argv"][1];
+       $driver = $_SERVER["argv"][1];
        array_shift($_SERVER["argv"]);
 }
 
@@ -195,7 +195,7 @@ $filename = dirname(__FILE__) . "/adminer/drivers/mysql.inc.php";
 preg_match_all('~\\bfunction ([^(]+)~', file_get_contents($filename), $matches); //! respect context (extension, class)
 $functions = array_combine($matches[1], $matches[0]);
 unset($functions["__destruct"], $functions["Min_DB"], $functions["Min_Result"]);
-foreach (glob(dirname(__FILE__) . "/adminer/drivers/" . ($DRIVER ? $DRIVER : "*") . ".inc.php") as $filename) {
+foreach (glob(dirname(__FILE__) . "/adminer/drivers/" . ($driver ? $driver : "*") . ".inc.php") as $filename) {
        if ($filename != "mysql.inc.php") {
                $file = file_get_contents($filename);
                foreach ($functions as $val) {
@@ -206,14 +206,14 @@ foreach (glob(dirname(__FILE__) . "/adminer/drivers/" . ($DRIVER ? $DRIVER : "*"
        }
 }
 
-$drivers = array();
+include dirname(__FILE__) . "/adminer/include/pdo.inc.php";
 foreach (array("adminer", "editor") as $project) {
        $lang_ids = array(); // global variable simplifies usage in a callback function
        $file = file_get_contents(dirname(__FILE__) . "/$project/index.php");
-       if ($DRIVER) {
+       if ($driver) {
                $connection = (object) array("server_info" => 5.1); // MySQL support is version specific
-               $_GET[$DRIVER] = true; // to load the driver
-               include_once dirname(__FILE__) . "/adminer/drivers/$DRIVER.inc.php";
+               $_GET[$driver] = true; // to load the driver
+               include_once dirname(__FILE__) . "/adminer/drivers/$driver.inc.php";
                foreach (array("view", "event", "privileges", "user", "processlist", "variables", "trigger", "scheme") as $feature) {
                        if (!support($feature)) {
                                $file = str_replace("} elseif (isset(\$_GET[\"$feature\"])) {\n\tinclude \"./$feature.inc.php\";\n", "", $file);
@@ -227,8 +227,8 @@ foreach (array("adminer", "editor") as $project) {
        }
        $file = preg_replace_callback('~\\b(include|require) "([^"]*)";~', 'put_file', $file);
        $file = str_replace('include "../adminer/include/coverage.inc.php";', '', $file);
-       if ($DRIVER) {
-               $file = preg_replace('(include "../adminer/drivers/(?!' . preg_quote($DRIVER) . ').*\\s*)', '', $file);
+       if ($driver) {
+               $file = preg_replace('(include "../adminer/drivers/(?!' . preg_quote($driver) . ').*\\s*)', '', $file);
        }
        $file = preg_replace_callback('~\\b(include|require) "([^"]*)";~', 'put_file', $file); // bootstrap.inc.php
        $file = preg_replace_callback("~lang\\('((?:[^\\\\']+|\\\\.)*)'([,)])~s", 'lang_ids', $file);
@@ -248,7 +248,7 @@ foreach (array("adminer", "editor") as $project) {
        $file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
        $file = php_shrink($file);
 
-       $filename = $project . (preg_match('~-dev$~', $VERSION) ? "" : "-$VERSION") . ($DRIVER ? "-$DRIVER" : "") . ($_SESSION["lang"] ? "-$_SESSION[lang]" : "") . ".php";
+       $filename = $project . (preg_match('~-dev$~', $VERSION) ? "" : "-$VERSION") . ($driver ? "-$driver" : "") . ($_SESSION["lang"] ? "-$_SESSION[lang]" : "") . ".php";
        fwrite(fopen($filename, "w"), $file); // file_put_contents() since PHP 5
        echo "$filename created (" . strlen($file) . " B).\n";
 }