@@ -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', |
@@ -1,26 +1,26 @@ |
||
| 1 | -<?php if(is_array($this->headers)): ?> |
|
| 1 | +<?php if (is_array($this->headers)): ?> |
|
| 2 | 2 | <thead> |
| 3 | 3 | <tr> |
| 4 | -<?php if(isset($this->checkbox)): ?> |
|
| 4 | +<?php if (isset($this->checkbox)): ?> |
|
| 5 | 5 | <th class="dbadmin-table-checkbox"><input id="dbadmin-table-<?php |
| 6 | 6 | echo $this->checkbox ?>-all" type="checkbox" /></th> |
| 7 | 7 | <?php endif ?> |
| 8 | -<?php foreach($this->headers as $header): ?> |
|
| 8 | +<?php foreach ($this->headers as $header): ?> |
|
| 9 | 9 | <th><?php echo $header ?></th> |
| 10 | 10 | <?php endforeach ?> |
| 11 | 11 | </tr> |
| 12 | 12 | </thead> |
| 13 | 13 | <?php endif ?> |
| 14 | 14 | <tbody> |
| 15 | -<?php foreach($this->details as $details): ?> |
|
| 15 | +<?php foreach ($this->details as $details): ?> |
|
| 16 | 16 | <tr> |
| 17 | -<?php if(isset($this->checkbox)): ?> |
|
| 17 | +<?php if (isset($this->checkbox)): ?> |
|
| 18 | 18 | <td><input type="checkbox" class="dbadmin-table-<?php echo |
| 19 | 19 | $this->checkbox ?>" name="<?php echo $this->checkbox ?>[]" /></td> |
| 20 | 20 | <?php endif ?> |
| 21 | -<?php foreach($details as $detail): ?> |
|
| 22 | -<?php if(is_array($detail)): ?> |
|
| 23 | - <td<?php foreach($detail['props'] as $name => $value): ?> <?php |
|
| 21 | +<?php foreach ($details as $detail): ?> |
|
| 22 | +<?php if (is_array($detail)): ?> |
|
| 23 | + <td<?php foreach ($detail['props'] as $name => $value): ?> <?php |
|
| 24 | 24 | echo $name ?>="<?php echo $value ?>"<?php |
| 25 | 25 | endforeach ?>><?php echo $detail['label'] ?></td> |
| 26 | 26 | <?php else: ?> |
@@ -1,18 +1,18 @@ |
||
| 1 | -<?php if(is_array($this->headers)): ?> |
|
| 1 | +<?php if (is_array($this->headers)): ?> |
|
| 2 | 2 | -- Jaxon DbAdmin <?php echo $this->headers['version'], ' ', |
| 3 | 3 | $this->headers['driver'], ' ', |
| 4 | 4 | $this->headers['server'] ?> dump |
| 5 | 5 | |
| 6 | -<?php if(($this->headers['sql'])): ?> |
|
| 6 | +<?php if (($this->headers['sql'])): ?> |
|
| 7 | 7 | SET NAMES utf8; |
| 8 | 8 | SET time_zone = '+00:00'; |
| 9 | 9 | SET foreign_key_checks = 0; |
| 10 | -<?php if(($this->headers['data_style'])): ?> |
|
| 10 | +<?php if (($this->headers['data_style'])): ?> |
|
| 11 | 11 | SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; |
| 12 | 12 | <?php endif ?> |
| 13 | 13 | <?php endif ?> |
| 14 | 14 | |
| 15 | 15 | <?php endif ?> |
| 16 | -<?php foreach($this->queries as $query): ?> |
|
| 16 | +<?php foreach ($this->queries as $query): ?> |
|
| 17 | 17 | <?php echo $query, "\n" ?> |
| 18 | 18 | <?php endforeach ?> |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <nav><ul class="pagination"><?php |
| 2 | - if(($this->prev)) |
|
| 2 | + if (($this->prev)) |
|
| 3 | 3 | { |
| 4 | 4 | echo $this->prev; |
| 5 | 5 | } |
| 6 | - foreach($this->links as $link) |
|
| 6 | + foreach ($this->links as $link) |
|
| 7 | 7 | { |
| 8 | 8 | echo $link; |
| 9 | 9 | } |
| 10 | - if(($this->next)) |
|
| 10 | + if (($this->next)) |
|
| 11 | 11 | { |
| 12 | 12 | echo $this->next; |
| 13 | 13 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | { |
| 72 | 72 | // Check in server options |
| 73 | 73 | $serverAccess = $this->getOption("servers.$server.access.server", null); |
| 74 | - if($serverAccess === true || $serverAccess === false) |
|
| 74 | + if ($serverAccess === true || $serverAccess === false) |
|
| 75 | 75 | { |
| 76 | 76 | return $serverAccess; |
| 77 | 77 | } |
@@ -127,8 +127,7 @@ discard block |
||
| 127 | 127 | { |
| 128 | 128 | $defaultServer = $this->getOption('default'); |
| 129 | 129 | return !$defaultServer || |
| 130 | - !$this->getOption("servers.$defaultServer") ? '' : |
|
| 131 | - rq(Admin::class)->server($defaultServer); |
|
| 130 | + !$this->getOption("servers.$defaultServer") ? '' : rq(Admin::class)->server($defaultServer); |
|
| 132 | 131 | } |
| 133 | 132 | |
| 134 | 133 | /** |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | /** |
| 113 | 113 | * @inheritDoc |
| 114 | 114 | */ |
| 115 | - public function createConnection(array $options): AbstractConnection|null |
|
| 115 | + public function createConnection(array $options): AbstractConnection | null |
|
| 116 | 116 | { |
| 117 | 117 | return $this->driver->createConnection($options); |
| 118 | 118 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | /** |
| 163 | 163 | * @inheritDoc |
| 164 | 164 | */ |
| 165 | - public function execute(string $query): StatementInterface|bool |
|
| 165 | + public function execute(string $query): StatementInterface | bool |
|
| 166 | 166 | { |
| 167 | 167 | $result = $this->driver->execute($query); |
| 168 | 168 | // Call the query callbacks. |
@@ -63,8 +63,7 @@ discard block |
||
| 63 | 63 | // From edit.inc.php |
| 64 | 64 | $fields = $this->driver->fields($table); |
| 65 | 65 | // Important: get the where clauses before filtering the fields. |
| 66 | - $where = $this->operation === 'insert' ? [] : |
|
| 67 | - $this->driver->where($options, $fields); |
|
| 66 | + $where = $this->operation === 'insert' ? [] : $this->driver->where($options, $fields); |
|
| 68 | 67 | // Remove fields without the required privilege, or that cannot be edited. |
| 69 | 68 | $fields = array_filter($fields, fn(TableFieldEntity $field) => |
| 70 | 69 | isset($field->privileges[$this->operation]) && |
@@ -86,7 +85,7 @@ discard block |
||
| 86 | 85 | $this->action = 'read'; |
| 87 | 86 | $this->operation = 'insert'; |
| 88 | 87 | |
| 89 | - [$fields,] = $this->getFields($table, $options); |
|
| 88 | + [$fields, ] = $this->getFields($table, $options); |
|
| 90 | 89 | if (empty($fields)) { |
| 91 | 90 | return [ |
| 92 | 91 | 'error' => $this->utils->trans->lang('You have no privileges to update this table.'), |
@@ -114,8 +113,7 @@ discard block |
||
| 114 | 113 | $select = []; |
| 115 | 114 | foreach ($fields as $name => $field) { |
| 116 | 115 | if (isset($field->privileges["select"])) { |
| 117 | - $as = $this->action === 'clone' && $field->autoIncrement ? "''" : |
|
| 118 | - $this->driver->convertField($field); |
|
| 116 | + $as = $this->action === 'clone' && $field->autoIncrement ? "''" : $this->driver->convertField($field); |
|
| 119 | 117 | $select[] = ($as ? "$as AS " : "") . $this->driver->escapeId($name); |
| 120 | 118 | } |
| 121 | 119 | } |
@@ -160,7 +158,7 @@ discard block |
||
| 160 | 158 | } |
| 161 | 159 | |
| 162 | 160 | $rowData = $statement->fetchAssoc(); |
| 163 | - if($this->action === 'select' && (!$rowData || $statement->fetchAssoc())) |
|
| 161 | + if ($this->action === 'select' && (!$rowData || $statement->fetchAssoc())) |
|
| 164 | 162 | { |
| 165 | 163 | // $statement->rowCount() != 1 isn't available in all drivers |
| 166 | 164 | return [ |
@@ -187,7 +185,7 @@ discard block |
||
| 187 | 185 | $this->action = 'save'; |
| 188 | 186 | $this->operation = 'insert'; |
| 189 | 187 | |
| 190 | - [$fields,] = $this->getFields($table, $options); |
|
| 188 | + [$fields, ] = $this->getFields($table, $options); |
|
| 191 | 189 | $values = $this->reader()->getInputValues($fields, $values); |
| 192 | 190 | |
| 193 | 191 | if (!$this->driver->insert($table, $values)) { |
@@ -176,8 +176,7 @@ discard block |
||
| 176 | 176 | foreach ($grants as $object => $grant) { |
| 177 | 177 | //! separate db, table, columns, PROCEDURE|FUNCTION, routine |
| 178 | 178 | $headers[] = $object === '*.*' ? |
| 179 | - '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : |
|
| 180 | - '<input name="objects[' . $i . ']" value="' . $this->utils->str->html($object) . '" autocapitalize="off" />'; |
|
| 179 | + '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : '<input name="objects[' . $i . ']" value="' . $this->utils->str->html($object) . '" autocapitalize="off" />'; |
|
| 181 | 180 | $i++; |
| 182 | 181 | } |
| 183 | 182 | |
@@ -230,8 +229,7 @@ discard block |
||
| 230 | 229 | foreach ($userEntity->grants as $object => $grant) { |
| 231 | 230 | //! separate db, table, columns, PROCEDURE|FUNCTION, routine |
| 232 | 231 | $headers[] = $object === '*.*' ? |
| 233 | - '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : |
|
| 234 | - '<input name="objects[' . $i . ']" value="' . |
|
| 232 | + '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : '<input name="objects[' . $i . ']" value="' . |
|
| 235 | 233 | $this->utils->str->html($object) . '" autocapitalize="off" />'; |
| 236 | 234 | $i++; |
| 237 | 235 | } |
@@ -247,11 +245,11 @@ discard block |
||
| 247 | 245 | ], |
| 248 | 246 | 'pass' => [ |
| 249 | 247 | 'label' => $this->utils->trans->lang('Password'), |
| 250 | - 'value' => $userEntity->password , |
|
| 248 | + 'value' => $userEntity->password, |
|
| 251 | 249 | ], |
| 252 | 250 | 'hashed' => [ |
| 253 | 251 | 'label' => $this->utils->trans->lang('Hashed'), |
| 254 | - 'value' => ($userEntity->password !== ''), |
|
| 252 | + 'value' => ($userEntity->password !== ''), |
|
| 255 | 253 | ], |
| 256 | 254 | ]; |
| 257 | 255 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * @param array $types |
| 50 | 50 | * |
| 51 | 51 | * @return array |
| 52 | - */ |
|
| 52 | + */ |
|
| 53 | 53 | protected function values(array $row, array $blobs, array $types): array |
| 54 | 54 | { |
| 55 | 55 | $values = []; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * @param int $limit |
| 77 | 77 | * |
| 78 | 78 | * @return string |
| 79 | - */ |
|
| 79 | + */ |
|
| 80 | 80 | private function message($statement, int $limit): string |
| 81 | 81 | { |
| 82 | 82 | $numRows = $statement->rowCount(); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * @param int $limit |
| 99 | 99 | * |
| 100 | 100 | * @return array |
| 101 | - */ |
|
| 101 | + */ |
|
| 102 | 102 | protected function select($statement, int $limit = 0): array |
| 103 | 103 | { |
| 104 | 104 | // No resultset |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * @param QueryLogger|null $queryLogger |
| 48 | 48 | */ |
| 49 | 49 | public function __construct(AbstractFacade $dbFacade, |
| 50 | - protected TimerService $timer, protected QueryLogger|null $queryLogger) |
|
| 50 | + protected TimerService $timer, protected QueryLogger | null $queryLogger) |
|
| 51 | 51 | { |
| 52 | 52 | parent::__construct($dbFacade); |
| 53 | 53 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | ini_set('memory_limit', max($this->utils->iniBytes('memory_limit'), |
| 232 | 232 | 2 * strlen($queries) + memory_get_usage() + 8e6)); |
| 233 | 233 | } |
| 234 | - catch(\Exception $e) { |
|
| 234 | + catch (\Exception $e) { |
|
| 235 | 235 | // Do nothing if the option is not modified. |
| 236 | 236 | } |
| 237 | 237 | } |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | if ($commands === 0) { |
| 259 | 259 | $messages[] = $this->utils->trans->lang('No commands to execute.'); |
| 260 | 260 | } elseif ($onlyErrors) { |
| 261 | - $messages[] = $this->utils->trans->lang('%d query(s) executed OK.', $commands - $errors); |
|
| 261 | + $messages[] = $this->utils->trans->lang('%d query(s) executed OK.', $commands - $errors); |
|
| 262 | 262 | } |
| 263 | 263 | return [ |
| 264 | 264 | 'results' => $this->results, |
@@ -230,8 +230,7 @@ |
||
| 230 | 230 | try { |
| 231 | 231 | ini_set('memory_limit', max($this->utils->iniBytes('memory_limit'), |
| 232 | 232 | 2 * strlen($queries) + memory_get_usage() + 8e6)); |
| 233 | - } |
|
| 234 | - catch(\Exception $e) { |
|
| 233 | + } catch(\Exception $e) { |
|
| 235 | 234 | // Do nothing if the option is not modified. |
| 236 | 235 | } |
| 237 | 236 | } |