@@ -71,20 +71,20 @@ |
||
71 | 71 | |
72 | 72 | try { |
73 | 73 | if ( ! $this->redis->connect( |
74 | - $this->config[ 'host' ], |
|
75 | - ($this->config[ 'host' ][ 0 ] === '/' ? 0 |
|
76 | - : $this->config[ 'port' ]), |
|
77 | - $this->config[ 'timeout' ] |
|
74 | + $this->config['host'], |
|
75 | + ($this->config['host'][0] === '/' ? 0 |
|
76 | + : $this->config['port']), |
|
77 | + $this->config['timeout'] |
|
78 | 78 | ) |
79 | 79 | ) { |
80 | 80 | throw new RuntimeException('CACHE_REDIS_E_CONNECTION_FAILED'); |
81 | 81 | } |
82 | 82 | |
83 | - if (isset($this->config[ 'password' ]) AND ! $this->redis->auth($this->config[ 'password' ])) { |
|
83 | + if (isset($this->config['password']) AND ! $this->redis->auth($this->config['password'])) { |
|
84 | 84 | throw new DomainException('CACHE_REDIS_E_AUTHENTICATION_FAILED'); |
85 | 85 | } |
86 | 86 | |
87 | - if (isset($this->config[ 'dbIndex' ]) AND ! $this->redis->select($this->config[ 'dbIndex' ])) { |
|
87 | + if (isset($this->config['dbIndex']) AND ! $this->redis->select($this->config['dbIndex'])) { |
|
88 | 88 | throw new RuntimeException('CACHE_REDIS_E_DB_CONNECTION_FAILED'); |
89 | 89 | } |
90 | 90 | } catch (\RedisException $e) { |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | if (empty($keys)) { |
57 | 57 | $ucacheInfo = wincache_ucache_info(false); |
58 | 58 | |
59 | - foreach ($ucacheInfo[ 'ucache_entries' ] as $item) { |
|
60 | - $items[] = $this->getItem(str_replace($this->prefixKey, '', $item[ 'key_name' ])); |
|
59 | + foreach ($ucacheInfo['ucache_entries'] as $item) { |
|
60 | + $items[] = $this->getItem(str_replace($this->prefixKey, '', $item['key_name'])); |
|
61 | 61 | } |
62 | 62 | } elseif (count($keys)) { |
63 | 63 | foreach ($keys as $key) { |
@@ -188,8 +188,8 @@ discard block |
||
188 | 188 | public function save(CacheItemInterface $item) |
189 | 189 | { |
190 | 190 | $metadata = $item->getMetadata(); |
191 | - $metadata[ 'data' ] = $item->get(); |
|
191 | + $metadata['data'] = $item->get(); |
|
192 | 192 | |
193 | - return wincache_ucache_set($this->prefixKey . $item->getKey(), $metadata, $metadata[ 'ttl' ]); |
|
193 | + return wincache_ucache_set($this->prefixKey . $item->getKey(), $metadata, $metadata['ttl']); |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | \ No newline at end of file |
@@ -95,11 +95,11 @@ |
||
95 | 95 | $this->key = $key; |
96 | 96 | |
97 | 97 | // Set from item metadata |
98 | - if (isset($value[ 'ctime' ]) AND isset($value[ 'etime' ]) AND isset($value[ 'ttl' ]) AND isset($value[ 'data' ])) { |
|
99 | - $this->set($value[ 'data' ]); |
|
100 | - $this->createdAt = new \DateTime(date('r', $value[ 'ctime' ])); |
|
101 | - $this->expiresAt = new \DateTime(date('r', $value[ 'etime' ])); |
|
102 | - $this->expiresAfter($value[ 'ttl' ]); |
|
98 | + if (isset($value['ctime']) AND isset($value['etime']) AND isset($value['ttl']) AND isset($value['data'])) { |
|
99 | + $this->set($value['data']); |
|
100 | + $this->createdAt = new \DateTime(date('r', $value['ctime'])); |
|
101 | + $this->expiresAt = new \DateTime(date('r', $value['etime'])); |
|
102 | + $this->expiresAfter($value['ttl']); |
|
103 | 103 | } else { |
104 | 104 | // Set item value |
105 | 105 | $this->set($value); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $apcIterator = new \APCUIterator(); |
57 | 57 | |
58 | 58 | foreach ($apcIterator as $item) { |
59 | - $items[] = new Item(str_replace($this->prefixKey, '', $item[ 'key' ]), $item[ 'value' ]); |
|
59 | + $items[] = new Item(str_replace($this->prefixKey, '', $item['key']), $item['value']); |
|
60 | 60 | } |
61 | 61 | } elseif (count($keys)) { |
62 | 62 | foreach ($keys as $key) { |
@@ -190,8 +190,8 @@ discard block |
||
190 | 190 | public function save(CacheItemInterface $item) |
191 | 191 | { |
192 | 192 | $metadata = $item->getMetadata(); |
193 | - $metadata[ 'data' ] = $item->get(); |
|
193 | + $metadata['data'] = $item->get(); |
|
194 | 194 | |
195 | - return apcu_store($this->prefixKey . $item->getKey(), $metadata, $metadata[ 'ttl' ]); |
|
195 | + return apcu_store($this->prefixKey . $item->getKey(), $metadata, $metadata['ttl']); |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | \ No newline at end of file |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | foreach ($storage as $key => $item) { |
93 | 93 | if ($this->save($item) === true) { |
94 | - unset($storage[ $key ]); |
|
94 | + unset($storage[$key]); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | foreach ($keys as $key) { |
127 | 127 | if ($this->has($key)) { |
128 | - $result[ $key ] = $this->get($key, $default); |
|
128 | + $result[$key] = $this->get($key, $default); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | foreach ($values as $key => $value) { |
200 | 200 | if ($this->set($key, $value, $ttl)) { |
201 | - $result[ $key ] = true; |
|
201 | + $result[$key] = true; |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 |