@@ -273,7 +273,7 @@ |
||
273 | 273 | 'Modify' => 'Modificar', |
274 | 274 | 'Loading' => 'Cargando', |
275 | 275 | 'Load more data' => 'Cargar máis datos', |
276 | - '%d / ' => array('%d / ','%d / '), |
|
276 | + '%d / ' => array('%d / ', '%d / '), |
|
277 | 277 | 'Limit rows' => 'Limitar filas', |
278 | 278 | 'Default value' => 'Valor por defecto', |
279 | 279 | 'Full table scan' => 'Escaneo completo da táboa', |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | return [ |
24 | 24 | 'select' => $select, |
25 | - 'values' => (array)$options["columns"], |
|
25 | + 'values' => (array) $options["columns"], |
|
26 | 26 | 'columns' => $columns, |
27 | 27 | 'functions' => $this->driver->functions(), |
28 | 28 | 'grouping' => $this->driver->grouping(), |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | return [ |
47 | 47 | // 'where' => $where, |
48 | - 'values' => (array)$options["where"], |
|
48 | + 'values' => (array) $options["where"], |
|
49 | 49 | 'columns' => $columns, |
50 | 50 | 'indexes' => $indexes, |
51 | 51 | 'operators' => $this->driver->operators(), |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | private function getSortingOptions(array $order, array $columns, array $indexes, array $options) |
65 | 65 | { |
66 | 66 | $values = []; |
67 | - $descs = (array)$options["desc"]; |
|
68 | - foreach ((array)$options["order"] as $key => $value) { |
|
67 | + $descs = (array) $options["desc"]; |
|
68 | + foreach ((array) $options["order"] as $key => $value) { |
|
69 | 69 | $values[] = [ |
70 | 70 | 'col' => $value, |
71 | 71 | 'desc' => $descs[$key] ?? 0, |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | \preg_match('~char|text|enum|set~', $type) && strlen($value) > 64) { |
441 | 441 | $key = (\strpos($key, '(') ? $key : $this->driver->escapeId($key)); //! columns looking like functions |
442 | 442 | $key = "MD5(" . ($this->driver->jush() != 'sql' || \preg_match("~^utf8~", $collation) ? |
443 | - $key : "CONVERT($key USING " . $this->driver−>charset() . ")") . ")"; |
|
443 | + $key : "CONVERT($key USING " . $this->driver− > charset() . ")") . ")"; |
|
444 | 444 | $value = \md5($value); |
445 | 445 | } |
446 | 446 | if ($value !== null) { |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $this->viewAdmin = new ViewAdmin(); |
28 | 28 | $this->viewAdmin->init($this); |
29 | 29 | } |
30 | - return $this->viewAdmin ; |
|
30 | + return $this->viewAdmin; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -239,8 +239,7 @@ discard block |
||
239 | 239 | $row[$key] = '"' . \str_replace('"', '""', $val) . '"'; |
240 | 240 | } |
241 | 241 | } |
242 | - $separator = $this->options["format"] == "csv" ? "," : |
|
243 | - ($this->options["format"] == "tsv" ? "\t" : ";"); |
|
242 | + $separator = $this->options["format"] == "csv" ? "," : ($this->options["format"] == "tsv" ? "\t" : ";"); |
|
244 | 243 | $this->queries[] = \implode($separator, $row); |
245 | 244 | } |
246 | 245 | |
@@ -354,7 +353,7 @@ discard block |
||
354 | 353 | } else { |
355 | 354 | if (!$insert) { |
356 | 355 | $insert = "INSERT INTO " . $this->driver->table($table) . " (" . |
357 | - \implode(", ", \array_map(function ($key) { |
|
356 | + \implode(", ", \array_map(function($key) { |
|
358 | 357 | return $this->driver->escapeId($key); |
359 | 358 | }, $keys)) . ") VALUES"; |
360 | 359 | } |
@@ -273,14 +273,14 @@ discard block |
||
273 | 273 | $target .= '<b>' . $this->util->html($foreignKey->schema) . '</b>.'; |
274 | 274 | } |
275 | 275 | $target = $this->util->html($foreignKey->table) . |
276 | - '(' . \implode(', ', \array_map(function ($key) { |
|
276 | + '(' . \implode(', ', \array_map(function($key) { |
|
277 | 277 | return $this->util->html($key); |
278 | 278 | }, $foreignKey->target)) . ')'; |
279 | 279 | $details[] = [ |
280 | 280 | 'name' => $this->util->html($name), |
281 | 281 | 'source' => '<i>' . \implode( |
282 | 282 | '</i>, <i>', |
283 | - \array_map(function ($key) { |
|
283 | + \array_map(function($key) { |
|
284 | 284 | return $this->util->html($key); |
285 | 285 | }, $foreignKey->source) |
286 | 286 | ) . '</i>', |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | private function createOrAlterTable(array $values, string $table = '', array $origFields = []) |
465 | 465 | { |
466 | 466 | // From create.inc.php |
467 | - $values['fields'] = (array)$values['fields']; |
|
467 | + $values['fields'] = (array) $values['fields']; |
|
468 | 468 | if ($values['autoIncrementCol']) { |
469 | 469 | $values['fields'][$values['autoIncrementCol']]['autoIncrement'] = true; |
470 | 470 | } |
@@ -483,8 +483,7 @@ discard block |
||
483 | 483 | $field = TableFieldEntity::make($field); |
484 | 484 | $foreignKey = $this->foreignKeys[$field->type] ?? null; |
485 | 485 | //! can collide with user defined type |
486 | - $typeField = ($foreignKey === null ? $field : |
|
487 | - TableFieldEntity::make($this->referencableTables[$foreignKey])); |
|
486 | + $typeField = ($foreignKey === null ? $field : TableFieldEntity::make($this->referencableTables[$foreignKey])); |
|
488 | 487 | // Originally, deleted fields have the "field" field set to an empty string. |
489 | 488 | // But in our implementation, the "name" field is not set. |
490 | 489 | if ($field->name != '') { |
@@ -60,8 +60,7 @@ discard block |
||
60 | 60 | foreach ($grants as $object => $grant) { |
61 | 61 | //! separate db, table, columns, PROCEDURE|FUNCTION, routine |
62 | 62 | $headers[] = $object === '*.*' ? |
63 | - '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : |
|
64 | - '<input name="objects[' . $i . ']" value="' . $this->util->html($object) . '" autocapitalize="off" />'; |
|
63 | + '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : '<input name="objects[' . $i . ']" value="' . $this->util->html($object) . '" autocapitalize="off" />'; |
|
65 | 64 | $i++; |
66 | 65 | } |
67 | 66 | |
@@ -116,8 +115,7 @@ discard block |
||
116 | 115 | foreach ($grants as $object => $grant) { |
117 | 116 | //! separate db, table, columns, PROCEDURE|FUNCTION, routine |
118 | 117 | $headers[] = $object === '*.*' ? |
119 | - '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : |
|
120 | - '<input name="objects[' . $i . ']" value="' . |
|
118 | + '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : '<input name="objects[' . $i . ']" value="' . |
|
121 | 119 | $this->util->html($object) . '" autocapitalize="off" />'; |
122 | 120 | $i++; |
123 | 121 | } |
@@ -135,11 +133,11 @@ discard block |
||
135 | 133 | ], |
136 | 134 | 'pass' => [ |
137 | 135 | 'label' => $this->trans->lang('Password'), |
138 | - 'value' => $password , |
|
136 | + 'value' => $password, |
|
139 | 137 | ], |
140 | 138 | 'hashed' => [ |
141 | 139 | 'label' => $this->trans->lang('Hashed'), |
142 | - 'value' => ($password != ''), |
|
140 | + 'value' => ($password != ''), |
|
143 | 141 | ], |
144 | 142 | ]; |
145 | 143 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | * @param int |
44 | 44 | * |
45 | 45 | * @return array |
46 | - */ |
|
46 | + */ |
|
47 | 47 | protected function select($statement, $orgtables = [], $limit = 0) |
48 | 48 | { |
49 | 49 | $links = []; // colno => orgtable - create links from these columns |
@@ -96,8 +96,7 @@ discard block |
||
96 | 96 | if ($rowCount > 0) { |
97 | 97 | $numRows = $statement->numRows; |
98 | 98 | $message = ($numRows ? ($limit && $numRows > $limit ? |
99 | - $this->trans->lang('%d / ', $limit) : |
|
100 | - "") . $this->trans->lang('%d row(s)', $numRows) : ""); |
|
99 | + $this->trans->lang('%d / ', $limit) : "") . $this->trans->lang('%d row(s)', $numRows) : ""); |
|
101 | 100 | } |
102 | 101 | |
103 | 102 | // Table header |
@@ -179,9 +178,7 @@ discard block |
||
179 | 178 | $timestamps = []; |
180 | 179 | // TODO: Move this to driver implementations |
181 | 180 | $parse = '[\'"' . |
182 | - ($this->driver->jush() == "sql" ? '`#' : |
|
183 | - ($this->driver->jush() == "sqlite" ? '`[' : |
|
184 | - ($this->driver->jush() == "mssql" ? '[' : ''))) . ']|/\*|-- |$' . |
|
181 | + ($this->driver->jush() == "sql" ? '`#' : ($this->driver->jush() == "sqlite" ? '`[' : ($this->driver->jush() == "mssql" ? '[' : ''))) . ']|/\*|-- |$' . |
|
185 | 182 | ($this->driver->jush() == "pgsql" ? '|\$[^$]*\$' : ''); |
186 | 183 | // $total_start = \microtime(true); |
187 | 184 | // \parse_str($_COOKIE["adminer_export"], $adminer_export); |
@@ -207,8 +204,7 @@ discard block |
||
207 | 204 | |
208 | 205 | if ($found && \rtrim($found) != $delimiter) { |
209 | 206 | // find matching quote or comment end |
210 | - while (\preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' : |
|
211 | - (\preg_match('~^-- |^#~', $found) ? "\n" : \preg_quote($found) . |
|
207 | + while (\preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' : (\preg_match('~^-- |^#~', $found) ? "\n" : \preg_quote($found) . |
|
212 | 208 | "|\\\\."))) . '|$)s', $queries, $match, PREG_OFFSET_CAPTURE, $offset)) { |
213 | 209 | //! respect sql_mode NO_BACKSLASH_ESCAPES |
214 | 210 | $s = $match[0][0]; |
@@ -303,7 +299,7 @@ discard block |
||
303 | 299 | if ($empty) { |
304 | 300 | $messages[] = $this->trans->lang('No commands to execute.'); |
305 | 301 | } elseif ($onlyErrors) { |
306 | - $messages[] = $this->trans->lang('%d query(s) executed OK.', $commands - \count($errors)); |
|
302 | + $messages[] = $this->trans->lang('%d query(s) executed OK.', $commands - \count($errors)); |
|
307 | 303 | // $timestamps[] = $this->trans->formatTime($total_start); |
308 | 304 | } |
309 | 305 | // elseif($errors && $commands > 1) |
@@ -101,8 +101,7 @@ discard block |
||
101 | 101 | $maxlength = (!\preg_match('~int~', $field->type) && |
102 | 102 | \preg_match('~^(\d+)(,(\d+))?$~', $field->length, $match) ? |
103 | 103 | ((\preg_match("~binary~", $field->type) ? 2 : 1) * $match[1] + (($match[3] ?? null) ? 1 : 0) + |
104 | - (($match[2] ?? false) && !$unsigned ? 1 : 0)) : |
|
105 | - ($this->driver->typeExists($field->type) ? $this->driver->type($field->type) + ($unsigned ? 0 : 1) : 0)); |
|
104 | + (($match[2] ?? false) && !$unsigned ? 1 : 0)) : ($this->driver->typeExists($field->type) ? $this->driver->type($field->type) + ($unsigned ? 0 : 1) : 0)); |
|
106 | 105 | if ($this->driver->jush() == 'sql' && $this->driver->minVersion(5.6) && \preg_match('~time~', $field->type)) { |
107 | 106 | $maxlength += 7; // microtime |
108 | 107 | } |
@@ -261,7 +260,7 @@ discard block |
||
261 | 260 | } |
262 | 261 | $function = ( |
263 | 262 | $queryOptions["save"] |
264 | - ? (string)$queryOptions["function"][$name] |
|
263 | + ? (string) $queryOptions["function"][$name] |
|
265 | 264 | : ( |
266 | 265 | $update && \preg_match('~^CURRENT_TIMESTAMP~i', $field->onUpdate) |
267 | 266 | ? "now" |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | { |
199 | 199 | $servers = $this->getConfig()->getOption('servers', []); |
200 | 200 | $default = $this->getConfig()->getOption('default', ''); |
201 | - if(\array_key_exists($default, $servers)) |
|
201 | + if (\array_key_exists($default, $servers)) |
|
202 | 202 | { |
203 | 203 | return $default; |
204 | 204 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function getReadyScript() |
239 | 239 | { |
240 | - if(!($server = $this->getDefaultServer())) |
|
240 | + if (!($server = $this->getDefaultServer())) |
|
241 | 241 | { |
242 | 242 | return ''; |
243 | 243 | } |