From 61469f25a5e48f11188de9da480e91822f7ff3de Mon Sep 17 00:00:00 2001 From: whiteCcinn <471113744@qq.com> Date: Wed, 26 Sep 2018 21:43:54 +0800 Subject: [PATCH] fix https://github.com/swoft-cloud/swoft-component/pull/82 --- src/Profile/RedisProfile.php | 9 +++++++++ src/RedisConnection.php | 1 + 2 files changed, 10 insertions(+) diff --git a/src/Profile/RedisProfile.php b/src/Profile/RedisProfile.php index 89ad424..4f77350 100644 --- a/src/Profile/RedisProfile.php +++ b/src/Profile/RedisProfile.php @@ -20,6 +20,15 @@ abstract class RedisProfile implements ProfileInterface */ protected $processor; + /** + * Setter prefix + * @param string $prefix + */ + public function setPrefix(string $prefix) + { + $this->processor->setPrefix($prefix); + } + /** * Init */ diff --git a/src/RedisConnection.php b/src/RedisConnection.php index 125011a..a2a5aa4 100644 --- a/src/RedisConnection.php +++ b/src/RedisConnection.php @@ -69,6 +69,7 @@ public function __call($method, $arguments) { /* @var RedisCommandProvider $commandProvider */ $commandProvider = App::getBean(RedisCommandProvider::class); + $commandProvider->setPrefix($this->pool->getPoolConfig()->getPrefix()); $command = $commandProvider->createCommand($method, $arguments); $arguments = $command->getArguments(); $method = $command->getId();