Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #846 from yl/patch-1
Added *scan functions to Redis component.
- Loading branch information
Showing
5 changed files
with
84 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ | |
|
||
class Redis | ||
{ | ||
use ScanCaller; | ||
|
||
/** | ||
* @var PoolFactory | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of Hyperf. | ||
* | ||
* @link https://www.hyperf.io | ||
* @document https://doc.hyperf.io | ||
* @contact group@hyperf.io | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
|
||
namespace Hyperf\Redis; | ||
|
||
trait ScanCaller | ||
{ | ||
public function scan(&$cursor, $pattern = null, $count = 0) | ||
{ | ||
return $this->__call('scan', [&$cursor, $pattern, $count]); | ||
} | ||
|
||
public function hScan($key, &$cursor, $pattern = null, $count = 0) | ||
{ | ||
return $this->__call('hScan', [$key, &$cursor, $pattern, $count]); | ||
} | ||
|
||
public function zScan($key, &$cursor, $pattern = null, $count = 0) | ||
{ | ||
return $this->__call('zScan', [$key, &$cursor, $pattern, $count]); | ||
} | ||
|
||
public function sScan($key, &$cursor, $pattern = null, $count = 0) | ||
{ | ||
return $this->__call('sScan', [$key, &$cursor, $pattern, $count]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters