Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
phcent committed Mar 14, 2024
1 parent fd79d72 commit 7b3f50c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/CacheFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ protected function createRedisDriver(array $config)
$redisConfig = \config('redis');
$client = $redisConfig['client'] ?? 'phpredis';

$store = new RedisStore(new RedisManager('', $client, $redisConfig), $this->getPrefix($config), $connection);
$store = new RedisStore(new RedisFactory(), $this->getPrefix($config), $connection);

return $this->repository(
$store->setLockConnection($config['lock_connection'] ?? $connection)
Expand Down
15 changes: 15 additions & 0 deletions src/RedisFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ final class RedisFactory implements Factory

public function connection($name = null)
{
if($name == null){
$name = 'default';
}
return Redis::connection($name);
}

/**
* Pass methods onto the default Redis connection.
*
* @param string $method
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
{
return $this->connection()->{$method}(...$parameters);
}
}

0 comments on commit 7b3f50c

Please sign in to comment.