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(6y ago)032MITPHPPHP &gt;=7.1

Since Jul 23Pushed 5y 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 1w 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 12% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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

2215d 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

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[phpfastcache/phpssdb

PHP SSDB Driver for phpFastCache

14736.9k1](/packages/phpfastcache-phpssdb)[rapidwebltd/rw-file-cache

RW File Cache is a PHP File-based Caching Library. Its syntax is designed to closely resemble the PHP memcache extension.

15196.8k7](/packages/rapidwebltd-rw-file-cache)[yuzuru-s/redis-recommend

Wrapping Redis's sorted set APIs for specializing recommending operations.

392.9k](/packages/yuzuru-s-redis-recommend)

PHPackages © 2026

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