@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : ''; |
142 | 142 | $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : ''; |
143 | 143 | $buckets = isset($this->config[ 'buckets' ]) ? $this->config[ 'buckets' ] : [ |
144 | - [ |
|
144 | + [ |
|
145 | 145 | 'bucket' => 'default', |
146 | 146 | 'password' => '', |
147 | - ], |
|
147 | + ], |
|
148 | 148 | ]; |
149 | 149 | |
150 | 150 | $this->instance = new CouchbaseClient("couchbase://{$host}:{$port}", $username, $password); |
@@ -194,10 +194,10 @@ discard block |
||
194 | 194 | $info = $this->getBucket()->manager()->info(); |
195 | 195 | |
196 | 196 | return (new DriverStatistic()) |
197 | - ->setSize($info[ 'basicStats' ][ 'diskUsed' ]) |
|
198 | - ->setRawData($info) |
|
199 | - ->setData(implode(', ', array_keys($this->itemInstances))) |
|
200 | - ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400, |
|
201 | - 1) . "\n For more information see RawData."); |
|
197 | + ->setSize($info[ 'basicStats' ][ 'diskUsed' ]) |
|
198 | + ->setRawData($info) |
|
199 | + ->setData(implode(', ', array_keys($this->itemInstances))) |
|
200 | + ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400, |
|
201 | + 1) . "\n For more information see RawData."); |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | \ No newline at end of file |
@@ -136,11 +136,11 @@ discard block |
||
136 | 136 | } else { |
137 | 137 | |
138 | 138 | |
139 | - $host = isset($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1'; |
|
140 | - $port = isset($this->config[ 'port' ]) ? $this->config[ 'port' ] : 8091; |
|
141 | - $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : ''; |
|
142 | - $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : ''; |
|
143 | - $buckets = isset($this->config[ 'buckets' ]) ? $this->config[ 'buckets' ] : [ |
|
139 | + $host = isset($this->config['host']) ? $this->config['host'] : '127.0.0.1'; |
|
140 | + $port = isset($this->config['port']) ? $this->config['port'] : 8091; |
|
141 | + $password = isset($this->config['password']) ? $this->config['password'] : ''; |
|
142 | + $username = isset($this->config['username']) ? $this->config['username'] : ''; |
|
143 | + $buckets = isset($this->config['buckets']) ? $this->config['buckets'] : [ |
|
144 | 144 | [ |
145 | 145 | 'bucket' => 'default', |
146 | 146 | 'password' => '', |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | $this->instance = new CouchbaseClient("couchbase://{$host}:{$port}", $username, $password); |
151 | 151 | |
152 | 152 | foreach ($buckets as $bucket) { |
153 | - $this->bucketCurrent = $this->bucketCurrent ?: $bucket[ 'bucket' ]; |
|
154 | - $this->setBucket($bucket[ 'bucket' ], $this->instance->openBucket($bucket[ 'bucket' ], $bucket[ 'password' ])); |
|
153 | + $this->bucketCurrent = $this->bucketCurrent ?: $bucket['bucket']; |
|
154 | + $this->setBucket($bucket['bucket'], $this->instance->openBucket($bucket['bucket'], $bucket['password'])); |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | protected function getBucket() |
165 | 165 | { |
166 | - return $this->bucketInstances[ $this->bucketCurrent ]; |
|
166 | + return $this->bucketInstances[$this->bucketCurrent]; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | protected function setBucket($bucketName, \CouchbaseBucket $CouchbaseBucket) |
175 | 175 | { |
176 | 176 | if (!array_key_exists($bucketName, $this->bucketInstances)) { |
177 | - $this->bucketInstances[ $bucketName ] = $CouchbaseBucket; |
|
177 | + $this->bucketInstances[$bucketName] = $CouchbaseBucket; |
|
178 | 178 | } else { |
179 | 179 | throw new phpFastCacheLogicException('A bucket instance with this name already exists.'); |
180 | 180 | } |
@@ -194,10 +194,10 @@ discard block |
||
194 | 194 | $info = $this->getBucket()->manager()->info(); |
195 | 195 | |
196 | 196 | return (new DriverStatistic()) |
197 | - ->setSize($info[ 'basicStats' ][ 'diskUsed' ]) |
|
197 | + ->setSize($info['basicStats']['diskUsed']) |
|
198 | 198 | ->setRawData($info) |
199 | 199 | ->setData(implode(', ', array_keys($this->itemInstances))) |
200 | - ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400, |
|
200 | + ->setInfo('CouchBase version ' . $info['nodes'][0]['version'] . ', Uptime (in days): ' . round($info['nodes'][0]['uptime'] / 86400, |
|
201 | 201 | 1) . "\n For more information see RawData."); |
202 | 202 | } |
203 | 203 | } |
204 | 204 | \ No newline at end of file |