From f05f4b4cbc4675f24449c70ab75366bd102c6ebc Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 6 Mar 2025 17:51:20 +0100 Subject: [PATCH] Change $jush to constant --- adminer/check.inc.php | 4 ++-- adminer/create.inc.php | 6 +++--- adminer/database.inc.php | 2 +- adminer/db.inc.php | 22 +++++++++++----------- adminer/dump.inc.php | 8 ++++---- adminer/edit.inc.php | 2 +- adminer/foreign.inc.php | 6 +++--- adminer/include/adminer.inc.php | 26 +++++++++++++------------- adminer/include/bootstrap.inc.php | 5 ++--- adminer/include/design.inc.php | 4 ++-- adminer/include/driver.inc.php | 4 ++-- adminer/include/editing.inc.php | 28 ++++++++++++---------------- adminer/include/functions.inc.php | 29 ++++++++++++++--------------- adminer/indexes.inc.php | 6 +++--- adminer/procedure.inc.php | 2 +- adminer/processlist.inc.php | 10 +++++----- adminer/script.inc.php | 2 +- adminer/select.inc.php | 14 +++++++------- adminer/sql.inc.php | 10 +++++----- adminer/table.inc.php | 2 +- adminer/trigger.inc.php | 2 +- adminer/type.inc.php | 2 +- adminer/variables.inc.php | 2 +- adminer/view.inc.php | 6 +++--- compile.php | 2 +- 25 files changed, 100 insertions(+), 106 deletions(-) diff --git a/adminer/check.inc.php b/adminer/check.inc.php index d75b0be4..6dd64831 100644 --- a/adminer/check.inc.php +++ b/adminer/check.inc.php @@ -6,7 +6,7 @@ $name = $_GET["name"]; $row = $_POST; if ($row && !$error) { - if ($jush == "sqlite") { + if (JUSH == "sqlite") { $result = recreate_table($TABLE, $TABLE, array(), array(), array(), 0, array(), $name, ($row["drop"] ? "" : $row["clause"])); } else { $result = ($name == "" || queries("ALTER TABLE " . table($TABLE) . " DROP CONSTRAINT " . idf_escape($name))); @@ -31,7 +31,7 @@ if (!$row) {

'; } echo doc_link(array( diff --git a/adminer/create.inc.php b/adminer/create.inc.php index cf7c81d4..0015748b 100644 --- a/adminer/create.inc.php +++ b/adminer/create.inc.php @@ -60,7 +60,7 @@ if ($_POST && !process_fields($row["fields"]) && !$error) { } } if ($foreign_key !== null) { - $foreign[idf_escape($field["field"])] = ($TABLE != "" && $jush != "sqlite" ? "ADD" : " ") . format_foreign_key(array( + $foreign[idf_escape($field["field"])] = ($TABLE != "" && JUSH != "sqlite" ? "ADD" : " ") . format_foreign_key(array( 'table' => $foreign_keys[$field["type"]], 'source' => array($field["field"]), 'target' => array($type_field["field"]), @@ -126,7 +126,7 @@ if ($_POST && !process_fields($row["fields"]) && !$error) { queries_redirect(ME . (support("table") ? "table=" : "select=") . urlencode($name), $message, alter_table( $TABLE, $name, - ($jush == "sqlite" && ($use_all_fields || $foreign) ? $all_fields : $fields), + (JUSH == "sqlite" && ($use_all_fields || $foreign) ? $all_fields : $fields), $foreign, ($row["Comment"] != $table_status["Comment"] ? $row["Comment"] : null), ($row["Engine"] && $row["Engine"] != $table_status["Engine"] ? $row["Engine"] : ""), @@ -183,7 +183,7 @@ foreach ($engines as $engine) { : data-maxlength="64" value="" autocapitalize="off"> " . optionlist(array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) . "" . on_help("getTarget(event).value", 1) . script("qsl('select').onchange = helpClose;") : ""); ?> - "(" . lang('collation') . ")") + $collations, $row["Collation"]) : ""); ?> + "(" . lang('collation') . ")") + $collations, $row["Collation"]) : ""); ?> diff --git a/adminer/database.inc.php b/adminer/database.inc.php index 341d2d0f..fed0964e 100644 --- a/adminer/database.inc.php +++ b/adminer/database.inc.php @@ -46,7 +46,7 @@ if ($_POST) { $name = $row["name"]; } elseif (DB != "") { $row["collation"] = db_collation(DB, $collations); -} elseif ($jush == "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]) { diff --git a/adminer/db.inc.php b/adminer/db.inc.php index 06b5b60b..563b71f5 100644 --- a/adminer/db.inc.php +++ b/adminer/db.inc.php @@ -6,7 +6,7 @@ $tables_views = array_merge((array) $_POST["tables"], (array) $_POST["views"]); if ($tables_views && !$error && !$_POST["search"]) { $result = true; $message = ""; - if ($jush == "sql" && $_POST["tables"] && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"] || $_POST["copy"])) { + if (JUSH == "sql" && $_POST["tables"] && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"] || $_POST["copy"])) { queries("SET foreign_key_checks = 0"); // allows to truncate or drop several tables at once } @@ -29,14 +29,14 @@ if ($tables_views && !$error && !$_POST["search"]) { $result = drop_tables($_POST["tables"]); } $message = lang('Tables have been dropped.'); - } elseif ($jush == "sqlite" && $_POST["check"]) { + } elseif (JUSH == "sqlite" && $_POST["check"]) { foreach ((array) $_POST["tables"] as $table) { foreach (get_rows("PRAGMA integrity_check(" . q($table) . ")") as $row) { $message .= "" . h($table) . ": " . h($row["integrity_check"]) . "
"; } } - } elseif ($jush != "sql") { - $result = ($jush == "sqlite" + } elseif (JUSH != "sql") { + $result = (JUSH == "sqlite" ? queries("VACUUM") : apply_queries("VACUUM" . ($_POST["optimize"] ? "" : " ANALYZE"), $_POST["tables"]) ); @@ -123,7 +123,7 @@ if ($adminer->homepage()) { } echo "" . lang('%d in total', count($tables_list)); - echo "" . h($jush == "sql" ? $connection->result("SELECT @@default_storage_engine") : ""); + echo "" . h(JUSH == "sql" ? $connection->result("SELECT @@default_storage_engine") : ""); echo "" . h(db_collation(DB, collations())); foreach (array("Data_length", "Index_length", "Data_free") as $key) { echo ""; @@ -135,19 +135,19 @@ if ($adminer->homepage()) { if (!information_schema(DB)) { echo "