@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | public function __construct($host = 'localhost', $port = '15672', $user = 'guest', $password = 'guest') |
| 12 | 12 | { |
| 13 | - $this->baseUrl = 'http://' . $user . ':' . $password . '@' . $host . ':' . $port; |
|
| 13 | + $this->baseUrl = 'http://'.$user.':'.$password.'@'.$host.':'.$port; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | /** |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $vhosts[] = $item; |
| 36 | 36 | continue; |
| 37 | 37 | } |
| 38 | - $permissions = $this->call('/api/vhosts/' . urlencode($item['name']) . '/permissions'); |
|
| 38 | + $permissions = $this->call('/api/vhosts/'.urlencode($item['name']).'/permissions'); |
|
| 39 | 39 | foreach ($permissions as $permission) { |
| 40 | 40 | if ($permission['user'] == $user) { |
| 41 | 41 | $vhosts[] = $item; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | { |
| 56 | 56 | $endpoint = '/api/queues'; |
| 57 | 57 | if ($vhost) { |
| 58 | - $endpoint .= '/' . urlencode($vhost); |
|
| 58 | + $endpoint .= '/'.urlencode($vhost); |
|
| 59 | 59 | } |
| 60 | 60 | $queues = $this->call($endpoint); |
| 61 | 61 | return $queues; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | return []; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - $endpoint = '/api/queues/' . urlencode($vhost) . '/' . urlencode($queue) . '/get'; |
|
| 77 | + $endpoint = '/api/queues/'.urlencode($vhost).'/'.urlencode($queue).'/get'; |
|
| 78 | 78 | $params = [ |
| 79 | 79 | 'count' => $count, |
| 80 | 80 | 'requeue' => true, |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | private function call($endpoint, $method = 'GET', $params = null) |
| 88 | 88 | { |
| 89 | - $ch = curl_init($this->baseUrl . $endpoint); |
|
| 89 | + $ch = curl_init($this->baseUrl.$endpoint); |
|
| 90 | 90 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 91 | 91 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
| 92 | 92 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | if (!$response) { |
| 100 | 100 | return []; |
| 101 | 101 | } |
| 102 | - $result = json_decode((string)$response, true); |
|
| 102 | + $result = json_decode((string) $response, true); |
|
| 103 | 103 | if (isset($result['error'])) { |
| 104 | 104 | throw new ConnectException($result['reason']); |
| 105 | 105 | } |
@@ -61,6 +61,10 @@ discard block |
||
| 61 | 61 | return $queues; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | + /** |
|
| 65 | + * @param string $vhost |
|
| 66 | + * @param string $queue |
|
| 67 | + */ |
|
| 64 | 68 | public function getMessages($vhost, $queue) |
| 65 | 69 | { |
| 66 | 70 | $count = 0; |
@@ -84,6 +88,9 @@ discard block |
||
| 84 | 88 | return $result; |
| 85 | 89 | } |
| 86 | 90 | |
| 91 | + /** |
|
| 92 | + * @param string $endpoint |
|
| 93 | + */ |
|
| 87 | 94 | private function call($endpoint, $method = 'GET', $params = null) |
| 88 | 95 | { |
| 89 | 96 | $ch = curl_init($this->baseUrl . $endpoint); |
@@ -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 | |
@@ -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 | } |
@@ -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 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | $tables = []; |
| 34 | 34 | } |
| 35 | 35 | $this->template->tables = $tables; |
| 36 | - $this->template->setFile(__DIR__ . '/default.latte'); |
|
| 36 | + $this->template->setFile(__DIR__.'/default.latte'); |
|
| 37 | 37 | $this->template->render(); |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | $this->template->type = $this->type; |
| 34 | 34 | $this->template->table = $this->table; |
| 35 | 35 | $this->template->item = $this->item; |
| 36 | - $this->template->setFile(__DIR__ . '/default.latte'); |
|
| 36 | + $this->template->setFile(__DIR__.'/default.latte'); |
|
| 37 | 37 | $this->template->render(); |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$container = require __DIR__ . '/../app/bootstrap.php'; |
|
| 3 | +$container = require __DIR__.'/../app/bootstrap.php'; |
|
| 4 | 4 | |
| 5 | 5 | $container->getService('application')->run(); |