|
@@ -137,10 +137,10 @@ discard block |
|
|
block discarded – undo |
|
137
|
137
|
} else { |
|
138
|
138
|
|
|
139
|
139
|
|
|
140
|
|
- $host = isset($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1'; |
|
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' ] : [ |
|
|
140
|
+ $host = isset($this->config['host']) ? $this->config['host'] : '127.0.0.1'; |
|
|
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 |
|
|
block discarded – undo |
|
150
|
150
|
$this->instance = new CouchbaseClient("couchbase://{$host}", $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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 \LogicException('A bucket instance with this name already exists.'); |
|
180
|
180
|
} |
|
@@ -194,9 +194,9 @@ discard block |
|
|
block discarded – undo |
|
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, 1) . "\n For more information see RawData."); |
|
|
200
|
+ ->setInfo('CouchBase version ' . $info['nodes'][0]['version'] . ', Uptime (in days): ' . round($info['nodes'][0]['uptime'] / 86400, 1) . "\n For more information see RawData."); |
|
201
|
201
|
} |
|
202
|
202
|
} |
|
203
|
203
|
\ No newline at end of file |