PHPackages                             edward1108/edward-redis - 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. edward1108/edward-redis

ActiveProject[Caching](/categories/caching)

edward1108/edward-redis
=======================

ThinkPHP框架的Redis扩展，支持多种Redis使用方法。支持ThinkPHP6.0和ThinkPHP5.x

1.3.1(5y ago)1158↓100%[1 issues](https://github.com/Edward1108/edward-redis/issues)MITPHPPHP &gt;=7.1.0

Since May 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Edward1108/edward-redis)[ Packagist](https://packagist.org/packages/edward1108/edward-redis)[ Docs](https://github.com/Edward1108/edward-redis)[ RSS](/packages/edward1108-edward-redis/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)DependenciesVersions (7)Used By (0)

edward-redis
============

[](#edward-redis)

ThinkPHP框架的Redis扩展，支持多种Redis使用方法。支持ThinkPHP6.0和ThinkPHP5.x

安装
--

[](#安装)

> composer require edward1108/edward-redis

配置
--

[](#配置)

ThinkPHP6.0.x 和 ThinkPHP5.1.x

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

```

ThinkPHP5.0.x

```
config.php
'redis'                  => [
    // 缓存前缀
    'prefix'        => '',
    // 缓存有效期 0表示永久缓存，单位：秒
    'expire'        => 0,
    // redis主机
    'host'          => '127.0.0.1',
    // redis端口
    'port'          => '',
    // 密码
    'password'      => '',
    // 操作库
    'select'        => 0,
    // 超时时间(秒)
    'timeout'       => 0,
    // 是否长连接
    'persistent'    => false,
]

```

例子
--

[](#例子)

```
