@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $tableForm->addFieldsToForm($form); |
| 50 | 50 | $form->addSubmit('save', 'Save'); |
| 51 | 51 | $form->onSuccess[] = [$tableForm, 'submit']; |
| 52 | - $form->onSuccess[] = function () { |
|
| 52 | + $form->onSuccess[] = function() { |
|
| 53 | 53 | $this->presenter->redirect('Table:default', $this->driver->type(), $this->database); |
| 54 | 54 | }; |
| 55 | 55 | return $form; |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | public function name() |
| 36 | 36 | { |
| 37 | - return $this->type() . '.name'; |
|
| 37 | + return $this->type().'.name'; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | return $count; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - $stats = $this->connection->getExtendedStats('cachedump', (int)$table); |
|
| 67 | + $stats = $this->connection->getExtendedStats('cachedump', (int) $table); |
|
| 68 | 68 | $keys = isset($stats[$this->database]) ? $stats[$this->database] : []; |
| 69 | 69 | return count($keys); |
| 70 | 70 | } |
@@ -47,14 +47,14 @@ |
||
| 47 | 47 | public function submit(Form $form, ArrayHash $values) |
| 48 | 48 | { |
| 49 | 49 | if ($this->database) { |
| 50 | - $query = 'ALTER DATABASE ' . $this->database; |
|
| 50 | + $query = 'ALTER DATABASE '.$this->database; |
|
| 51 | 51 | } else { |
| 52 | - $query = 'CREATE DATABASE ' . $values['name']; |
|
| 52 | + $query = 'CREATE DATABASE '.$values['name']; |
|
| 53 | 53 | } |
| 54 | 54 | if ($values['charset']) { |
| 55 | - $query .= ' CHARACTER SET ' . $values['charset']; |
|
| 55 | + $query .= ' CHARACTER SET '.$values['charset']; |
|
| 56 | 56 | if ($values['collation']) { |
| 57 | - $query .= ' COLLATE ' . $values['collation']; |
|
| 57 | + $query .= ' COLLATE '.$values['collation']; |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | if (strpos($credentials['server'], ':') !== false) { |
| 43 | 43 | list($host, $port) = explode(':', $credentials['server'], 2); |
| 44 | 44 | } |
| 45 | - $dsn = 'mysql:;host=' . $host . ';port=' . $port . ';charset=utf8'; |
|
| 45 | + $dsn = 'mysql:;host='.$host.';port='.$port.';charset=utf8'; |
|
| 46 | 46 | try { |
| 47 | 47 | $this->connection = new PDO($dsn, $credentials['user'], $credentials['password']); |
| 48 | 48 | } catch (PDOException $e) { |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | public function submit(Form $form, ArrayHash $values) |
| 30 | 30 | { |
| 31 | 31 | if ($this->connection->hlen($values['key']) > 0) { |
| 32 | - $form->addError('Key "' . $values['key'] . '" already exists'); |
|
| 32 | + $form->addError('Key "'.$values['key'].'" already exists'); |
|
| 33 | 33 | return; |
| 34 | 34 | } |
| 35 | 35 | $this->connection->hset($values['key'], $values['field'], $values['value']); |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | public function submit(Form $form, ArrayHash $values) |
| 33 | 33 | { |
| 34 | 34 | if (!$this->connection->rename($this->key, $values['new_key'])) { |
| 35 | - $form->addError('Key "' . $this->key . '" doesn\'t exist'); |
|
| 35 | + $form->addError('Key "'.$this->key.'" doesn\'t exist'); |
|
| 36 | 36 | return; |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -15,6 +15,9 @@ |
||
| 15 | 15 | |
| 16 | 16 | private $member; |
| 17 | 17 | |
| 18 | + /** |
|
| 19 | + * @param string $key |
|
| 20 | + */ |
|
| 18 | 21 | public function __construct(RedisProxy $connection, $key, $member) |
| 19 | 22 | { |
| 20 | 23 | $this->connection = $connection; |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | |
| 70 | 70 | $this->template->steps = $steps; |
| 71 | 71 | $this->template->paginator = $paginator; |
| 72 | - $this->template->setFile(dirname(__FILE__) . '/' . $this->paginatorTemplate . '.latte'); |
|
| 72 | + $this->template->setFile(dirname(__FILE__).'/'.$this->paginatorTemplate.'.latte'); |
|
| 73 | 73 | $this->template->render(); |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | $this->template->driver = $this->driver; |
| 30 | 30 | $this->template->actualDatabase = $this->database; |
| 31 | - $this->template->setFile(__DIR__ . '/default.latte'); |
|
| 31 | + $this->template->setFile(__DIR__.'/default.latte'); |
|
| 32 | 32 | $this->template->render(); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | sort($databases); |
| 39 | 39 | $form = new Form(); |
| 40 | 40 | $form->setRenderer(new BootstrapVerticalRenderer()); |
| 41 | - $form->addSelect('database', $this->translator->translate($this->driver->type() . '.database_select_control.database.label'), array_combine($databases, $databases)) |
|
| 42 | - ->setPrompt($this->translator->translate($this->driver->type() . '.database_select_control.database.prompt')) |
|
| 43 | - ->setAttribute('onchange', 'window.location = \'' . $this->presenter->link('Table:default', $this->driver->type()) . '&database=\' + this.value') |
|
| 41 | + $form->addSelect('database', $this->translator->translate($this->driver->type().'.database_select_control.database.label'), array_combine($databases, $databases)) |
|
| 42 | + ->setPrompt($this->translator->translate($this->driver->type().'.database_select_control.database.prompt')) |
|
| 43 | + ->setAttribute('onchange', 'window.location = \''.$this->presenter->link('Table:default', $this->driver->type()).'&database=\' + this.value') |
|
| 44 | 44 | ->setDefaultValue($this->database); |
| 45 | 45 | return $form; |
| 46 | 46 | } |