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

ActiveLibrary[Caching](/categories/caching)

webdcg/redis
============

Redis client for PHP using the PhpRedis C Extension

0.14.0(6y ago)13[2 issues](https://github.com/webdcg/redis/issues)MITPHPPHP ^7.2CI failing

Since Jan 1Pushed 6y ago1 watchersCompare

[ Source](https://github.com/webdcg/redis)[ Packagist](https://packagist.org/packages/webdcg/redis)[ Docs](https://github.com/webdcg/redis)[ RSS](/packages/webdcg-redis/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (6)Versions (16)Used By (0)

Redis client for PHP using the [PhpRedis](https://github.com/phpredis/phpredis) C Extension
===========================================================================================

[](#redis-client-for-php-using-the-phpredis-c-extension)

[![StyleCI](https://camo.githubusercontent.com/390e9a98b67b549289d17c2627d2d8ee34691943942df0cbec2c8edf816f653e/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3231373036363034322f736869656c64)](https://github.styleci.io/repos/217066042/shield)[![Latest Version on Packagist](https://camo.githubusercontent.com/f9a4b63fdbef350b9d0dd5c3f462ae61987e41a1c60cf3198785d6edee6a5cb9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7765626463672f72656469732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/webdcg/redis)[![Build Status](https://camo.githubusercontent.com/a00d7be535280a021b2cc0a7fe09f45c8c3adec6a6be764505843c1d7fd6949d/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7765626463672f72656469732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/webdcg/redis)[![Quality Score](https://camo.githubusercontent.com/6e6504f3e9734ed07a55f7496ae48a37f739cdea50d8d36964cae6b53f195fe3/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7765626463672f72656469732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/webdcg/redis)[![Total Downloads](https://camo.githubusercontent.com/01418f9fb32dc524aa6cc627723f8344a38b8d379620390714af3b5bdb9bf10c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7765626463672f72656469732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/webdcg/redis)

OOP Redis client for PHP using the [PhpRedis](https://github.com/phpredis/phpredis) C Extension

Table of contents
-----------------

[](#table-of-contents)

1. [Installation](#installation)
2. [Classes and methods](#classes-and-methods)
    - [Usage](#usage)
    - [Bits](#bits)
    - [Connection](#connection)
    - [Geocoding](#Geocoding)
    - [Hashes](#hashes)
    - [HyperLogLogs](#HyperLogLogs)
    - [Introspection](#introspection)
    - [Keys](#keys)
    - [Lists](#lists)
    - [Pub/sub](#pubsub)
    - [Scripting](#scripting)
    - [Sets](#sets)
    - [Sorted sets](#sorted-sets)
    - [Streams](#Streams)
    - [Strings](#strings)
    - [Transactions](#transactions)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require webdcg/redis
```

Classes and methods
-------------------

[](#classes-and-methods)

Usage
-----

[](#usage)

```
$redis = new Webdcg\Redis\Redis;
```

### [Bits](docs/bits.md)

[](#bits)

```
// Count set bits in a string
$redis->bitCount('key');
$redis->bitField('key');
$redis->bitPos('key');
$redis->bitOp('key');
$redis->getBit('key');
$redis->setBit('key');
```

### [Connection](docs/connection.md)

[](#connection)

```
$redis->connect('127.0.0.1', 6379);
$redis->open('127.0.0.1', 6379);
$redis->pconnect('127.0.0.1', 6379);
$redis->popen('127.0.0.1', 6379);
$redis->auth('secret');
$redis->select(1);
$redis->swapdb(0, 1);
$redis->close();
$redis->setOption(\Redis::OPT_PREFIX, 'redis:');
$redis->getOption(\Redis::OPT_PREFIX)
$redis->ping('pong');
$redis->echo('redis');
```

### [Geocoding](docs/geocoding.md)

[](#geocoding)

```
$options = ['WITHDIST'];
$redis->geoAdd('Geocoding', -122.431, 37.773, 'San Francisco');
$redis->geoAdd('Geocoding', -73.935242, 40.730610, 'New York');
$redis->geoHash('Geocoding', 'San Francisco');
$redis->geoPos('Geocoding', 'San Francisco');
$redis->geoDist('Geocoding', 'San Francisco', 'New York');
$redis->geoRadius("Geocoding", -157.858, 21.306, 300, 'mi', $options);
$redis->geoRadiusByMember("Geocoding", 'San Francisco', 300, 'mi', $options);
```

### [Hashes](docs/hashes.md)

[](#hashes)

```
$redis->del('key');
$redis->delete('key');
$redis->unlink('key');
```

### [HyperLogLogs](docs/hyperloglogs.md)

[](#hyperloglogs)

```
$redis->pfAdd('HyperLogLog', ['a', 'b', 'c']);
$redis->pfCount('HyperLogLog'); // 3
$redis->pfAdd('HyperLogLog2', ['b', 'd']);
$redis->pfMerge('HyperLogLogMerged', ['HyperLogLog', 'HyperLogLog2']);
$redis->pfCount('HyperLogLogMerged'); // 4 => a, b, c, d
```

### [Introspection](docs/introspection.md)

[](#introspection)

```
$redis->del('key');
$redis->delete('key');
$redis->unlink('key');
```

### [Keys](docs/keys.md)

[](#keys)

```
$redis->del('key');
$redis->delete('key');
$redis->unlink('key');
```

### [Lists](docs/lists.md)

[](#lists)

```
$redis->del('key');
$redis->delete('key');
$redis->unlink('key');
```

### [Pub/sub](docs/pubsub.md)

[](#pubsub)

```
$redis->del('key');
$redis->delete('key');
$redis->unlink('key');
```

### [Scripting](docs/scripting.md)

[](#scripting)

```
$redis->del('key');
$redis->delete('key');
$redis->unlink('key');
```

### [Sets](docs/sets.md)

[](#sets)

```
$redis->del('key');
$redis->delete('key');
$redis->unlink('key');
```

### [Sorted Sets](docs/sorted-sets.md)

[](#sorted-sets)

```
$redis->del('key');
$redis->delete('key');
$redis->unlink('key');
```

### [Streams](docs/streams.md)

[](#streams)

```
$redis->del('key');
$redis->delete('key');
$redis->unlink('key');
```

### [Strings](docs/strings.md)

[](#strings)

```
// Simple key -> value set
$redis->set('key', 'value');
// Will redirect, and actually make an SETEX call
$redis->set('key', 'value', 10);
// Will set the key, if it doesn't exist, with a ttl of 10 seconds
$redis->set('key:'.time(), 'value', ['nx', 'ex' => 10]);
// Will set a key, if it does exist, with a ttl of 1000 miliseconds
$redis->set('key', 'value', ['xx', 'px' => 1000]);
$redis->setEx('key', 10, 'value');
```

### [Transactions](docs/transactions.md)

[](#transactions)

```
$redis->del('key');
$redis->delete('key');
$redis->unlink('key');
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Roberto Luna Rojas](https://github.com/webdcg)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

PHP Package Boilerplate
-----------------------

[](#php-package-boilerplate)

This package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.3% 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

Every ~4 days

Total

14

Last Release

2270d ago

PHP version history (2 changes)0.1.0PHP ^7.1

0.4.0PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a0876a55eaaeb6666703953b4499ea05781fbeb49dc521ee1cbd137bd9a54d7?d=identicon)[rluna](/maintainers/rluna)

---

Top Contributors

[![rlunar](https://avatars.githubusercontent.com/u/2453805?v=4)](https://github.com/rlunar "rlunar (363 commits)")[![pch-rluna](https://avatars.githubusercontent.com/u/24482572?v=4)](https://github.com/pch-rluna "pch-rluna (113 commits)")

---

Tags

phpredisextensionphprediswebdcg

###  Code Quality

TestsPHPUnit

Code StyleECS

### Embed Badge

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

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

###  Alternatives

[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[averias/phpredis-json

A PHP client for RedisJSON module using phpredis extension

3429.3k](/packages/averias-phpredis-json)[swoft/redis

swoft redis component

12168.4k16](/packages/swoft-redis)[craftsys/laravel-redis-session-enhanced

Enhanced redis driver for sessions in Laravel

106.6k](/packages/craftsys-laravel-redis-session-enhanced)[eftec/cacheone

A Cache library with minimum dependency

103.5k4](/packages/eftec-cacheone)

PHPackages © 2026

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