mirror of
https://github.com/vrana/adminer.git
synced 2025-11-16 10:05:51 +01:00
Utilize single parameter implode
This commit is contained in:
@@ -586,7 +586,7 @@ if (!defined("DRIVER")) {
|
|||||||
$alter = array();
|
$alter = array();
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$alter[] = ($field[1]
|
$alter[] = ($field[1]
|
||||||
? ($table != "" ? ($field[0] != "" ? "CHANGE " . idf_escape($field[0]) : "ADD") : " ") . " " . implode("", $field[1]) . ($table != "" ? " $field[2]" : "")
|
? ($table != "" ? ($field[0] != "" ? "CHANGE " . idf_escape($field[0]) : "ADD") : " ") . " " . implode($field[1]) . ($table != "" ? " $field[2]" : "")
|
||||||
: "DROP " . idf_escape($field[0])
|
: "DROP " . idf_escape($field[0])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . $connection->qu
|
|||||||
$val[1] = ($val[1] == "bigint" ? " big" : " ") . "serial";
|
$val[1] = ($val[1] == "bigint" ? " big" : " ") . "serial";
|
||||||
}
|
}
|
||||||
if ($field[0] == "") {
|
if ($field[0] == "") {
|
||||||
$alter[] = ($table != "" ? "ADD " : " ") . implode("", $val);
|
$alter[] = ($table != "" ? "ADD " : " ") . implode($val);
|
||||||
} else {
|
} else {
|
||||||
if ($column != $val[0]) {
|
if ($column != $val[0]) {
|
||||||
$queries[] = "ALTER TABLE " . idf_escape($table) . " RENAME $column TO $val[0]";
|
$queries[] = "ALTER TABLE " . idf_escape($table) . " RENAME $column TO $val[0]";
|
||||||
|
|||||||
@@ -394,7 +394,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
|||||||
$alter = array();
|
$alter = array();
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
if ($field[1]) {
|
if ($field[1]) {
|
||||||
$alter[] = ($table != "" && $field[0] == "" ? "ADD " : " ") . implode("", $field[1]);
|
$alter[] = ($table != "" && $field[0] == "" ? "ADD " : " ") . implode($field[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$alter = array_merge($alter, $foreign);
|
$alter = array_merge($alter, $foreign);
|
||||||
@@ -524,7 +524,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
|||||||
|
|
||||||
function trigger_sql($table, $style) {
|
function trigger_sql($table, $style) {
|
||||||
global $connection;
|
global $connection;
|
||||||
return implode("", get_vals("SELECT sql || ';;\n' FROM sqlite_master WHERE type = 'trigger' AND name = " . $connection->quote($table)));
|
return implode(get_vals("SELECT sql || ';;\n' FROM sqlite_master WHERE type = 'trigger' AND name = " . $connection->quote($table)));
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_variables() {
|
function show_variables() {
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ function php_shrink($input) {
|
|||||||
|
|
||||||
arsort($short_variables);
|
arsort($short_variables);
|
||||||
foreach (array_keys($short_variables) as $number => $key) {
|
foreach (array_keys($short_variables) as $number => $key) {
|
||||||
$short_variables[$key] = short_identifier($number, implode("", range('a', 'z')) . '_' . implode("", range('A', 'Z'))); // could use also numbers and \x7f-\xff
|
$short_variables[$key] = short_identifier($number, implode(range('a', 'z')) . '_' . implode(range('A', 'Z'))); // could use also numbers and \x7f-\xff
|
||||||
}
|
}
|
||||||
|
|
||||||
$set = array_flip(preg_split('//', '!"#$&\'()*+,-./:;<=>?@[\]^`{|}'));
|
$set = array_flip(preg_split('//', '!"#$&\'()*+,-./:;<=>?@[\]^`{|}'));
|
||||||
|
|||||||
Reference in New Issue
Block a user