@@ 219-231 (lines=13) @@ | ||
216 | * @param integer $count |
|
217 | * @return array|boolean|null list of found keys, returns null if $iterator is 0 or '0' |
|
218 | */ |
|
219 | public function scan(&$iterator, $pattern = null, $count = null) |
|
220 | { |
|
221 | if ((string)$iterator === '0') { |
|
222 | return null; |
|
223 | } |
|
224 | $this->init(); |
|
225 | if ($this->driver instanceof Client) { |
|
226 | $returned = $this->driver->scan($iterator, ['match' => $pattern, 'count' => $count]); |
|
227 | $iterator = $returned[0]; |
|
228 | return $returned[1]; |
|
229 | } |
|
230 | return $this->driver->scan($iterator, $pattern, $count); |
|
231 | } |
|
232 | ||
233 | /** |
|
234 | * Get the value of a hash field |
|
@@ 310-322 (lines=13) @@ | ||
307 | * @param integer $count |
|
308 | * @return array|boolean|null list of found fields with associated values, returns null if $iterator is 0 or '0' |
|
309 | */ |
|
310 | public function hscan($key, &$iterator, $pattern = null, $count = null) |
|
311 | { |
|
312 | if ((string)$iterator === '0') { |
|
313 | return null; |
|
314 | } |
|
315 | $this->init(); |
|
316 | if ($this->driver instanceof Client) { |
|
317 | $returned = $this->driver->hscan($key, $iterator, ['match' => $pattern, 'count' => $count]); |
|
318 | $iterator = $returned[0]; |
|
319 | return $returned[1]; |
|
320 | } |
|
321 | return $this->driver->hscan($key, $iterator, $pattern, $count); |
|
322 | } |
|
323 | ||
324 | /** |
|
325 | * Add one or more members to a set |
|
@@ 370-382 (lines=13) @@ | ||
367 | * @param integer $count |
|
368 | * @return array|boolean|null list of found members, returns null if $iterator is 0 or '0' |
|
369 | */ |
|
370 | public function sscan($key, &$iterator, $pattern = null, $count = null) |
|
371 | { |
|
372 | if ((string)$iterator === '0') { |
|
373 | return null; |
|
374 | } |
|
375 | $this->init(); |
|
376 | if ($this->driver instanceof Client) { |
|
377 | $returned = $this->driver->sscan($key, $iterator, ['match' => $pattern, 'count' => $count]); |
|
378 | $iterator = $returned[0]; |
|
379 | return $returned[1]; |
|
380 | } |
|
381 | return $this->driver->sscan($key, $iterator, $pattern, $count); |
|
382 | } |
|
383 | ||
384 | private function convertFalseToNull($result) |
|
385 | { |