@@ -147,10 +147,10 @@ |
||
147 | 147 | { |
148 | 148 | try{ |
149 | 149 | $server = isset($this->config[ 'ssdb' ]) ? $this->config[ 'ssdb' ] : [ |
150 | - 'host' => "127.0.0.1", |
|
151 | - 'port' => 8888, |
|
152 | - 'password' => '', |
|
153 | - 'timeout' => 2000, |
|
150 | + 'host' => "127.0.0.1", |
|
151 | + 'port' => 8888, |
|
152 | + 'password' => '', |
|
153 | + 'timeout' => 2000, |
|
154 | 154 | ]; |
155 | 155 | |
156 | 156 | $host = $server[ 'host' ]; |
@@ -145,18 +145,18 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function driverConnect() |
147 | 147 | { |
148 | - try{ |
|
149 | - $server = isset($this->config[ 'ssdb' ]) ? $this->config[ 'ssdb' ] : [ |
|
148 | + try { |
|
149 | + $server = isset($this->config['ssdb']) ? $this->config['ssdb'] : [ |
|
150 | 150 | 'host' => "127.0.0.1", |
151 | 151 | 'port' => 8888, |
152 | 152 | 'password' => '', |
153 | 153 | 'timeout' => 2000, |
154 | 154 | ]; |
155 | 155 | |
156 | - $host = $server[ 'host' ]; |
|
157 | - $port = isset($server[ 'port' ]) ? (int) $server[ 'port' ] : 8888; |
|
158 | - $password = isset($server[ 'password' ]) ? $server[ 'password' ] : ''; |
|
159 | - $timeout = !empty($server[ 'timeout' ]) ? (int) $server[ 'timeout' ] : 2000; |
|
156 | + $host = $server['host']; |
|
157 | + $port = isset($server['port']) ? (int) $server['port'] : 8888; |
|
158 | + $password = isset($server['password']) ? $server['password'] : ''; |
|
159 | + $timeout = !empty($server['timeout']) ? (int) $server['timeout'] : 2000; |
|
160 | 160 | $this->instance = new SimpleSSDB($host, $port, $timeout); |
161 | 161 | if (!empty($password)) { |
162 | 162 | $this->instance->auth($password); |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | } else { |
168 | 168 | return true; |
169 | 169 | } |
170 | - }catch(SSDBException $e){ |
|
171 | - throw new phpFastCacheDriverException('Ssdb failed to connect with error: '. $e->getMessage(), 0 , $e); |
|
170 | + } catch (SSDBException $e) { |
|
171 | + throw new phpFastCacheDriverException('Ssdb failed to connect with error: ' . $e->getMessage(), 0, $e); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 |
@@ -167,7 +167,7 @@ |
||
167 | 167 | } else { |
168 | 168 | return true; |
169 | 169 | } |
170 | - }catch(SSDBException $e){ |
|
170 | + } catch(SSDBException $e){ |
|
171 | 171 | throw new phpFastCacheDriverException('Ssdb failed to connect with error: '. $e->getMessage(), 0 , $e); |
172 | 172 | } |
173 | 173 | } |