PHPackages                             xiucaiwu/tp5redis - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. xiucaiwu/tp5redis

ActiveLibrary[Caching](/categories/caching)

xiucaiwu/tp5redis
=================

The ThinkPHP5 Redis Classes

1.1(6y ago)960861MITPHPPHP &gt;=5.4.0

Since Dec 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/xiucaiwu/tp5redis)[ Packagist](https://packagist.org/packages/xiucaiwu/tp5redis)[ Docs](https://github.com/xiucaiwu/tp5redis)[ RSS](/packages/xiucaiwu-tp5redis/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (1)

tp5redis
========

[](#tp5redis)

tp5下的Redis操作类,对原Redis的二次封装,支持编辑器识别

安装
--

[](#安装)

> composer require "xiucaiwu/tp5redis:1.0.\*"

配置
--

[](#配置)

tp5.0

```
config.php
'redis'                  => [
	'host' => '127.0.0.1', // redis主机
	'port' => '', // redis端口
	'password' => '', // 密码
	'select' => 0, // 操作库
	'expire' => 0, // 有效期(秒)
	'timeout' => 0, // 超时时间(秒)
	'persistent' => true, // 是否长连接
	'prefix' => '', //前缀
]

```

tp5.1

```
config/redis.php
return [
	'host' => '127.0.0.1', // redis主机
	'port' => '', // redis端口
	'password' => '', // 密码
	'select' => 0, // 操作库
	'expire' => 0, // 有效期(秒)
	'timeout' => 0, // 超时时间(秒)
	'persistent' => true, // 是否长连接
	'prefix' => '', //前缀
];

```

例子
--

[](#例子)

```
