PHPackages                             lizus/php-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. lizus/php-redis

ActiveLibrary[Caching](/categories/caching)

lizus/php-redis
===============

php redis class

v0.0.1(5y ago)032MITPHPPHP &gt;=7.1

Since Jul 23Pushed 4y agoCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

php-redis
=========

[](#php-redis)

php redis class

First thing to do
-----------------

[](#first-thing-to-do)

Define your host and port, if empty it will use 127.0.0.1 and 6379 as port.

```
if (!defined('PHPREDIS_HOST')) define('PHPREDIS_HOST', '127.0.0.1');
if (!defined('PHPREDIS_PORT')) define('PHPREDIS_PORT', '6379');
```

If your redis need auth:

```
if (!defined('PHPREDIS_AUTH')) define('PHPREDIS_AUTH', 'your auth');
```

Chose database:

```
if (!defined('PHPREDIS_DATABASE')) define('PHPREDIS_DATABASE', 'your database');
```

or you can use `protected $database=1` to select your database

or you can run the class method `select();` to select your database, this may change the proteced var $database

use sample
----------

[](#use-sample)

```
use \Lizus\PHPRedis\PHPRedis;

class SampleRedis extends PHPRedis
{
    protected $database=1; //Not necessary 自定义数据库
    protected $host='127.0.0.1'; //Not necessary 自定义host
    protected $port='6379'; //Not necessary 自定义port
    protected $auth='***'; //Not necessary 自定义auth
}

$a=new SampleRedis('sampleName');

$a->set('sample data');

var_dump($a->get());
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2117d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a0aed58fd8cecb60124971238760d453634d22344572f2fc0153d76b935fab9?d=identicon)[lizus](/maintainers/lizus)

---

Top Contributors

[![lizus](https://avatars.githubusercontent.com/u/6037525?v=4)](https://github.com/lizus "lizus (8 commits)")

### Embed Badge

![Health badge](/badges/lizus-php-redis/health.svg)

```
[![Health](https://phpackages.com/badges/lizus-php-redis/health.svg)](https://phpackages.com/packages/lizus-php-redis)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
