@@ -132,12 +132,12 @@ discard block |
||
132 | 132 | $servers = (!empty($this->config[ 'servers' ]) && is_array($this->config[ 'servers' ]) ? $this->config[ 'servers' ] : []); |
133 | 133 | if (count($servers) < 1) { |
134 | 134 | $servers = [ |
135 | - [ |
|
135 | + [ |
|
136 | 136 | 'host' => !empty($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1', |
137 | 137 | 'port' => !empty($this->config[ 'port' ]) ? $this->config[ 'port' ] : 11211, |
138 | 138 | 'sasl_user' => !empty($this->config[ 'sasl_user' ]) ? $this->config[ 'sasl_user' ] : false, |
139 | 139 | 'sasl_password' => !empty($this->config[ 'sasl_password' ]) ? $this->config[ 'sasl_password' ] : false, |
140 | - ], |
|
140 | + ], |
|
141 | 141 | ]; |
142 | 142 | } |
143 | 143 | |
@@ -174,9 +174,9 @@ discard block |
||
174 | 174 | $date = (new \DateTime())->setTimestamp(time() - $stats[ 'uptime' ]); |
175 | 175 | |
176 | 176 | return (new driverStatistic()) |
177 | - ->setData(implode(', ', array_keys($this->itemInstances))) |
|
178 | - ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822))) |
|
179 | - ->setRawData($stats) |
|
180 | - ->setSize($stats[ 'bytes' ]); |
|
177 | + ->setData(implode(', ', array_keys($this->itemInstances))) |
|
178 | + ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822))) |
|
179 | + ->setRawData($stats) |
|
180 | + ->setSize($stats[ 'bytes' ]); |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 | \ No newline at end of file |
@@ -129,14 +129,14 @@ discard block |
||
129 | 129 | $this->instance = new MemcachedSoftware(); |
130 | 130 | $this->instance->setOption(\Memcached::OPT_BINARY_PROTOCOL, true); |
131 | 131 | |
132 | - $servers = (!empty($this->config[ 'servers' ]) && is_array($this->config[ 'servers' ]) ? $this->config[ 'servers' ] : []); |
|
132 | + $servers = (!empty($this->config['servers']) && is_array($this->config['servers']) ? $this->config['servers'] : []); |
|
133 | 133 | if (count($servers) < 1) { |
134 | 134 | $servers = [ |
135 | 135 | [ |
136 | - 'host' => !empty($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1', |
|
137 | - 'port' => !empty($this->config[ 'port' ]) ? $this->config[ 'port' ] : 11211, |
|
138 | - 'sasl_user' => !empty($this->config[ 'sasl_user' ]) ? $this->config[ 'sasl_user' ] : false, |
|
139 | - 'sasl_password' => !empty($this->config[ 'sasl_password' ]) ? $this->config[ 'sasl_password' ] : false, |
|
136 | + 'host' => !empty($this->config['host']) ? $this->config['host'] : '127.0.0.1', |
|
137 | + 'port' => !empty($this->config['port']) ? $this->config['port'] : 11211, |
|
138 | + 'sasl_user' => !empty($this->config['sasl_user']) ? $this->config['sasl_user'] : false, |
|
139 | + 'sasl_password' => !empty($this->config['sasl_password']) ? $this->config['sasl_password'] : false, |
|
140 | 140 | ], |
141 | 141 | ]; |
142 | 142 | } |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | if (!$this->instance->addServer($server['host'], $server['port'])) { |
147 | 147 | $this->fallback = true; |
148 | 148 | } |
149 | - if(!empty($server[ 'sasl_user' ]) && !empty($server[ 'sasl_password'])){ |
|
150 | - $this->instance->setSaslAuthData($server[ 'sasl_user' ], $server[ 'sasl_password']); |
|
149 | + if (!empty($server['sasl_user']) && !empty($server['sasl_password'])) { |
|
150 | + $this->instance->setSaslAuthData($server['sasl_user'], $server['sasl_password']); |
|
151 | 151 | } |
152 | 152 | } catch (\Exception $e) { |
153 | 153 | $this->fallback = true; |
@@ -167,16 +167,16 @@ discard block |
||
167 | 167 | public function getStats() |
168 | 168 | { |
169 | 169 | $stats = (array) $this->instance->getStats(); |
170 | - $stats[ 'uptime' ] = (isset($stats[ 'uptime' ]) ? $stats[ 'uptime' ] : 0); |
|
171 | - $stats[ 'version' ] = (isset($stats[ 'version' ]) ? $stats[ 'version' ] : 'UnknownVersion'); |
|
172 | - $stats[ 'bytes' ] = (isset($stats[ 'bytes' ]) ? $stats[ 'version' ] : 0); |
|
170 | + $stats['uptime'] = (isset($stats['uptime']) ? $stats['uptime'] : 0); |
|
171 | + $stats['version'] = (isset($stats['version']) ? $stats['version'] : 'UnknownVersion'); |
|
172 | + $stats['bytes'] = (isset($stats['bytes']) ? $stats['version'] : 0); |
|
173 | 173 | |
174 | - $date = (new \DateTime())->setTimestamp(time() - $stats[ 'uptime' ]); |
|
174 | + $date = (new \DateTime())->setTimestamp(time() - $stats['uptime']); |
|
175 | 175 | |
176 | 176 | return (new driverStatistic()) |
177 | 177 | ->setData(implode(', ', array_keys($this->itemInstances))) |
178 | - ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822))) |
|
178 | + ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats['version'], $date->format(DATE_RFC2822))) |
|
179 | 179 | ->setRawData($stats) |
180 | - ->setSize($stats[ 'bytes' ]); |
|
180 | + ->setSize($stats['bytes']); |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 | \ No newline at end of file |