@@ -128,10 +128,10 @@ discard block |
||
128 | 128 | $config = isset($this->config[ 'predis' ]) ? $this->config[ 'predis' ] : []; |
129 | 129 | |
130 | 130 | $this->instance = new PredisClient(array_merge([ |
131 | - 'host' => '127.0.0.1', |
|
132 | - 'port' => 6379, |
|
133 | - 'password' => null, |
|
134 | - 'database' => null, |
|
131 | + 'host' => '127.0.0.1', |
|
132 | + 'port' => 6379, |
|
133 | + 'password' => null, |
|
134 | + 'database' => null, |
|
135 | 135 | ], $config)); |
136 | 136 | |
137 | 137 | try{ |
@@ -174,9 +174,9 @@ discard block |
||
174 | 174 | $date = (isset($info['Server'][ 'uptime_in_seconds' ]) ? (new \DateTime())->setTimestamp(time() - $info['Server'][ 'uptime_in_seconds' ]) : 'unknown date'); |
175 | 175 | |
176 | 176 | return (new DriverStatistic()) |
177 | - ->setData(implode(', ', array_keys($this->itemInstances))) |
|
178 | - ->setRawData($info) |
|
179 | - ->setSize($size) |
|
180 | - ->setInfo(sprintf("The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.", $version, $date->format(DATE_RFC2822))); |
|
177 | + ->setData(implode(', ', array_keys($this->itemInstances))) |
|
178 | + ->setRawData($info) |
|
179 | + ->setSize($size) |
|
180 | + ->setInfo(sprintf("The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.", $version, $date->format(DATE_RFC2822))); |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 | \ No newline at end of file |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | protected function driverConnect() |
127 | 127 | { |
128 | - $config = isset($this->config[ 'predis' ]) ? $this->config[ 'predis' ] : []; |
|
128 | + $config = isset($this->config['predis']) ? $this->config['predis'] : []; |
|
129 | 129 | |
130 | 130 | $this->instance = new PredisClient(array_merge([ |
131 | 131 | 'host' => '127.0.0.1', |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | 'database' => null, |
135 | 135 | ], $config)); |
136 | 136 | |
137 | - try{ |
|
137 | + try { |
|
138 | 138 | $this->instance->connect(); |
139 | - }catch(PredisConnectionException $e){ |
|
139 | + } catch (PredisConnectionException $e) { |
|
140 | 140 | throw new phpFastCacheDriverException('Failed to connect to predis server', 0, $e); |
141 | 141 | } |
142 | 142 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $info = $this->instance->info(); |
172 | 172 | $size = (isset($info['Memory']['used_memory']) ? $info['Memory']['used_memory'] : 0); |
173 | 173 | $version = (isset($info['Server']['redis_version']) ? $info['Server']['redis_version'] : 0); |
174 | - $date = (isset($info['Server'][ 'uptime_in_seconds' ]) ? (new \DateTime())->setTimestamp(time() - $info['Server'][ 'uptime_in_seconds' ]) : 'unknown date'); |
|
174 | + $date = (isset($info['Server']['uptime_in_seconds']) ? (new \DateTime())->setTimestamp(time() - $info['Server']['uptime_in_seconds']) : 'unknown date'); |
|
175 | 175 | |
176 | 176 | return (new DriverStatistic()) |
177 | 177 | ->setData(implode(', ', array_keys($this->itemInstances))) |
@@ -136,7 +136,7 @@ |
||
136 | 136 | |
137 | 137 | try{ |
138 | 138 | $this->instance->connect(); |
139 | - }catch(PredisConnectionException $e){ |
|
139 | + } catch(PredisConnectionException $e){ |
|
140 | 140 | throw new phpFastCacheDriverException('Failed to connect to predis server', 0, $e); |
141 | 141 | } |
142 | 142 |