@@ -127,14 +127,14 @@ discard block |
||
| 127 | 127 | protected function driverConnect() |
| 128 | 128 | { |
| 129 | 129 | $server = isset($this->config[ 'redis' ]) ? $this->config[ 'redis' ] : [ |
| 130 | - 'host' => '127.0.0.1', |
|
| 131 | - 'port' => '6379', |
|
| 132 | - 'password' => '', |
|
| 133 | - 'database' => '', |
|
| 130 | + 'host' => '127.0.0.1', |
|
| 131 | + 'port' => '6379', |
|
| 132 | + 'password' => '', |
|
| 133 | + 'database' => '', |
|
| 134 | 134 | ]; |
| 135 | 135 | |
| 136 | 136 | $config = [ |
| 137 | - 'host' => $server[ 'host' ], |
|
| 137 | + 'host' => $server[ 'host' ], |
|
| 138 | 138 | ]; |
| 139 | 139 | |
| 140 | 140 | $port = isset($server[ 'port' ]) ? $server[ 'port' ] : ''; |
@@ -184,9 +184,9 @@ discard block |
||
| 184 | 184 | $date = (isset($info['Server'][ 'uptime_in_seconds' ]) ? (new \DateTime())->setTimestamp(time() - $info['Server'][ 'uptime_in_seconds' ]) : 'unknown date'); |
| 185 | 185 | |
| 186 | 186 | return (new driverStatistic()) |
| 187 | - ->setData(implode(', ', array_keys($this->itemInstances))) |
|
| 188 | - ->setRawData($this->instance->info()) |
|
| 189 | - ->setSize($size) |
|
| 190 | - ->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))); |
|
| 187 | + ->setData(implode(', ', array_keys($this->itemInstances))) |
|
| 188 | + ->setRawData($this->instance->info()) |
|
| 189 | + ->setSize($size) |
|
| 190 | + ->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))); |
|
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | \ No newline at end of file |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | protected function driverConnect() |
| 128 | 128 | { |
| 129 | - $server = isset($this->config[ 'redis' ]) ? $this->config[ 'redis' ] : [ |
|
| 129 | + $server = isset($this->config['redis']) ? $this->config['redis'] : [ |
|
| 130 | 130 | 'host' => '127.0.0.1', |
| 131 | 131 | 'port' => '6379', |
| 132 | 132 | 'password' => '', |
@@ -134,32 +134,32 @@ discard block |
||
| 134 | 134 | ]; |
| 135 | 135 | |
| 136 | 136 | $config = [ |
| 137 | - 'host' => $server[ 'host' ], |
|
| 137 | + 'host' => $server['host'], |
|
| 138 | 138 | ]; |
| 139 | 139 | |
| 140 | - $port = isset($server[ 'port' ]) ? $server[ 'port' ] : ''; |
|
| 140 | + $port = isset($server['port']) ? $server['port'] : ''; |
|
| 141 | 141 | if ($port != '') { |
| 142 | - $config[ 'port' ] = $port; |
|
| 142 | + $config['port'] = $port; |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - $password = isset($server[ 'password' ]) ? $server[ 'password' ] : ''; |
|
| 145 | + $password = isset($server['password']) ? $server['password'] : ''; |
|
| 146 | 146 | if ($password != '') { |
| 147 | - $config[ 'password' ] = $password; |
|
| 147 | + $config['password'] = $password; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - $database = isset($server[ 'database' ]) ? $server[ 'database' ] : ''; |
|
| 150 | + $database = isset($server['database']) ? $server['database'] : ''; |
|
| 151 | 151 | if ($database != '') { |
| 152 | - $config[ 'database' ] = $database; |
|
| 152 | + $config['database'] = $database; |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - $timeout = isset($server[ 'timeout' ]) ? $server[ 'timeout' ] : ''; |
|
| 155 | + $timeout = isset($server['timeout']) ? $server['timeout'] : ''; |
|
| 156 | 156 | if ($timeout != '') { |
| 157 | - $config[ 'timeout' ] = $timeout; |
|
| 157 | + $config['timeout'] = $timeout; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - $read_write_timeout = isset($server[ 'read_write_timeout' ]) ? $server[ 'read_write_timeout' ] : ''; |
|
| 160 | + $read_write_timeout = isset($server['read_write_timeout']) ? $server['read_write_timeout'] : ''; |
|
| 161 | 161 | if ($read_write_timeout != '') { |
| 162 | - $config[ 'read_write_timeout' ] = $read_write_timeout; |
|
| 162 | + $config['read_write_timeout'] = $read_write_timeout; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | $this->instance = new PredisClient($config); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $info = $this->instance->info(); |
| 182 | 182 | $size = (isset($info['Memory']['used_memory']) ? $info['Memory']['used_memory'] : 0); |
| 183 | 183 | $version = (isset($info['Server']['redis_version']) ? $info['Server']['redis_version'] : 0); |
| 184 | - $date = (isset($info['Server'][ 'uptime_in_seconds' ]) ? (new \DateTime())->setTimestamp(time() - $info['Server'][ 'uptime_in_seconds' ]) : 'unknown date'); |
|
| 184 | + $date = (isset($info['Server']['uptime_in_seconds']) ? (new \DateTime())->setTimestamp(time() - $info['Server']['uptime_in_seconds']) : 'unknown date'); |
|
| 185 | 185 | |
| 186 | 186 | return (new driverStatistic()) |
| 187 | 187 | ->setData(implode(', ', array_keys($this->itemInstances))) |