@@ -52,7 +52,7 @@ |
||
52 | 52 | $this->viewAdmin = new ViewAdmin(); |
53 | 53 | $this->viewAdmin->init($this->admin()); |
54 | 54 | } |
55 | - return $this->viewAdmin ; |
|
55 | + return $this->viewAdmin; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -93,8 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function applySqlFunction(string $function, string $column) |
95 | 95 | { |
96 | - return ($function ? ($function == 'unixepoch' ? "DATETIME($column, '$function')" : |
|
97 | - ($function == 'count distinct' ? 'COUNT(DISTINCT ' : strtoupper("$function(")) . "$column)") : $column); |
|
96 | + return ($function ? ($function == 'unixepoch' ? "DATETIME($column, '$function')" : ($function == 'count distinct' ? 'COUNT(DISTINCT ' : strtoupper("$function(")) . "$column)") : $column); |
|
98 | 97 | } |
99 | 98 | |
100 | 99 | /** |
@@ -169,7 +168,7 @@ discard block |
||
169 | 168 | } |
170 | 169 | } |
171 | 170 | if (\preg_match("~ IDENTIFIED BY PASSWORD '([^']+)~", $row[0], $match)) { |
172 | - $password = $match[1]; |
|
171 | + $password = $match[1]; |
|
173 | 172 | } |
174 | 173 | } |
175 | 174 | } |
@@ -96,8 +96,7 @@ discard block |
||
96 | 96 | if ($rowCount > 0) { |
97 | 97 | $numRows = $statement->rowCount(); |
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 |
@@ -158,7 +157,7 @@ discard block |
||
158 | 157 | \ini_set("memory_limit", \max($this->util->iniBytes("memory_limit"), |
159 | 158 | 2 * \strlen($queries) + \memory_get_usage() + 8e6)); |
160 | 159 | } |
161 | - catch(\Excpetion $e){} |
|
160 | + catch (\Excpetion $e) {} |
|
162 | 161 | } |
163 | 162 | |
164 | 163 | // if($queries != "" && \strlen($queries) < 1e6) { // don't add big queries |
@@ -180,9 +179,7 @@ discard block |
||
180 | 179 | $timestamps = []; |
181 | 180 | // TODO: Move this to driver implementations |
182 | 181 | $parse = '[\'"' . |
183 | - ($this->driver->jush() == "sql" ? '`#' : |
|
184 | - ($this->driver->jush() == "sqlite" ? '`[' : |
|
185 | - ($this->driver->jush() == "mssql" ? '[' : ''))) . ']|/\*|-- |$' . |
|
182 | + ($this->driver->jush() == "sql" ? '`#' : ($this->driver->jush() == "sqlite" ? '`[' : ($this->driver->jush() == "mssql" ? '[' : ''))) . ']|/\*|-- |$' . |
|
186 | 183 | ($this->driver->jush() == "pgsql" ? '|\$[^$]*\$' : ''); |
187 | 184 | // $total_start = \microtime(true); |
188 | 185 | // \parse_str($_COOKIE["adminer_export"], $adminer_export); |
@@ -209,8 +206,7 @@ discard block |
||
209 | 206 | |
210 | 207 | if ($found && \rtrim($found) != $delimiter) { |
211 | 208 | // find matching quote or comment end |
212 | - while (\preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' : |
|
213 | - (\preg_match('~^-- |^#~', $found) ? "\n" : \preg_quote($found) . |
|
209 | + while (\preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' : (\preg_match('~^-- |^#~', $found) ? "\n" : \preg_quote($found) . |
|
214 | 210 | "|\\\\."))) . '|$)s', $queries, $match, PREG_OFFSET_CAPTURE, $offset)) { |
215 | 211 | //! respect sql_mode NO_BACKSLASH_ESCAPES |
216 | 212 | $s = $match[0][0]; |
@@ -304,7 +300,7 @@ discard block |
||
304 | 300 | if ($empty) { |
305 | 301 | $messages[] = $this->trans->lang('No commands to execute.'); |
306 | 302 | } elseif ($onlyErrors) { |
307 | - $messages[] = $this->trans->lang('%d query(s) executed OK.', $commands - \count($errors)); |
|
303 | + $messages[] = $this->trans->lang('%d query(s) executed OK.', $commands - \count($errors)); |
|
308 | 304 | // $timestamps[] = $this->trans->formatTime($total_start); |
309 | 305 | } |
310 | 306 | // elseif($errors && $commands > 1) |