whereof/think-redis

This package is abandoned and no longer maintained. The author suggests using the tp5er/think-redis package instead.

An easy way to use the official PHP predis client in your thinkphp applications.

1.0.0 2022-03-30 02:11 UTC

This package is auto-updated.

Last update: 2022-05-05 01:53:25 UTC


README

composer require whereof/think-redis

基本配置

REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWD=

常规使用

$redis = new \Predis\Client($parameters = null, $options = null);
$redis->set('test','test');

您现在可以简单地替换最后两行:

$return = \whereof\think\redis\Redis::set('test','test');

这将在默认连接上运行命令。 你可以运行一个命令 任何连接(参见 defaultConnection 设置和 connections 数组 配置文件)。

$return = \whereof\think\redis\Redis::connection('connectionName')->set('test','test');

Copyright and License

Copyright (c) 2021 wangzhiqiang