Commit 8cae3b17 by feixiang

redis 扩展增加去除设置过的前缀功能

parent bd1ccacf
......@@ -12,14 +12,24 @@ use Swoft\Redis\Operator\Processor\PrefixProcessor;
class Redis extends \Swoft\Redis\Redis
{
private $prefix;
/**
* 设置redis前缀
* @param $prefix
*/
public function setPrefix($prefix)
{
$this->prefix = $prefix;
}
public function call(string $method, array $params)
{
$config = App::getBean(PrefixProcessor::class);
$config->setPrefix($prefix);
$config->setPrefix($this->prefix);
$res = parent::call($method, $params);
$config->setPrefix(config("redis.prefix",''));
return $res;
}
public function __destruct()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment