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