PHPackages                             samsmithkruz/redis-client-class - 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. samsmithkruz/redis-client-class

ActiveLibrary[Caching](/categories/caching)

samsmithkruz/redis-client-class
===============================

A powerful and intuitive Redis client for PHP developers.

1.0.1.1(1y ago)13MITPHPPHP ^7.3 || ^8.0CI passing

Since Apr 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/samsmithKruz/redis_client_class)[ Packagist](https://packagist.org/packages/samsmithkruz/redis-client-class)[ Docs](https://github.com/samsmithKruz/redis_client_class)[ RSS](/packages/samsmithkruz-redis-client-class/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (2)Used By (0)

RedisClient - PHP Redis Wrapper
===============================

[](#redisclient---php-redis-wrapper)

[![Packagist Downloads](https://camo.githubusercontent.com/489e777e97fa8957c9c0ac32def8883a4af7a718cc072b0c420ead53df9f4836/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616d736d6974686b72757a2f72656469732d636c69656e742d636c617373)](https://camo.githubusercontent.com/489e777e97fa8957c9c0ac32def8883a4af7a718cc072b0c420ead53df9f4836/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616d736d6974686b72757a2f72656469732d636c69656e742d636c617373)[![GitHub issues](https://camo.githubusercontent.com/1071bfaa48191b763ed85e4fd728e5126fe601938c0603a6b977c7b01f30b49c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f73616d736d6974684b72757a2f72656469735f636c69656e745f636c617373)](https://github.com/samsmithKruz/redis_client_class/issues)[![GitHub forks](https://camo.githubusercontent.com/f4fdeb49faefcba2e9158932545d56dbe8e9f3bd03f982f58aa3c5f56686afce/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f73616d736d6974684b72757a2f72656469735f636c69656e745f636c617373)](https://github.com/samsmithKruz/redis_client_class/network)[![GitHub stars](https://camo.githubusercontent.com/d69517d4bbf29ef4524e20e7ae369fd7e291a7b0c10c7977006350e80149e62a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f73616d736d6974684b72757a2f72656469735f636c69656e745f636c617373)](https://github.com/samsmithKruz/redis_client_class/stargazers)

RedisClient is a **developer-friendly PHP class** that provides a **clean and intuitive API** for working with Redis. It covers **all major Redis operations**, including:

- **Basic Key-Value Operations**: Insert, update, delete, select
- **Hashes**: Hash insert, update, delete, select
- **Lists**: Push, pop, range selection
- **Sets &amp; Sorted Sets**: Add, remove, get members, score-based retrieval
- **Transactions**: Multi-exec transactional execution
- **Pub/Sub**: Publish and subscribe to channels
- **Expirations &amp; TTL**: Set timeouts for keys
- **Advanced Features**: Pipelines, scripting, streams, and more

🚀 Installation
--------------

[](#-installation)

Clone the repository:

```
git clone https://github.com/samsmithKruz/redis_client_class.git
cd redis-client
```

Ensure you have the **Redis PHP extension** installed. If not, install it:

```
sudo apt install php-redis  # For Linux
brew install redis          # For Mac
```

⚡ Usage
-------

[](#-usage)

### 1️⃣ Initialize the RedisClient

[](#1️⃣-initialize-the-redisclient)

```
require 'RedisClient.php';

$redis = new RedisClient(); // Default: 127.0.0.1:6379
```

### 2️⃣ Basic Key Operations

[](#2️⃣-basic-key-operations)

```
$redis->insert('username', 'john_doe', 3600); // Store for 1 hour
echo $redis->select('username'); // Output: john_doe
$redis->update('username', 'jane_doe');
$redis->delete('username');
```

### 3️⃣ Hash Operations

[](#3️⃣-hash-operations)

```
$redis->hash_insert('user:1', 'name', 'John Doe');
echo $redis->hash_select('user:1', 'name'); // Output: John Doe
```

### 4️⃣ List Operations

[](#4️⃣-list-operations)

```
$redis->push('queue', 'task_1');
$redis->push('queue', 'task_2');
echo $redis->pop('queue'); // Output: task_2
```

### 5️⃣ Pub/Sub

[](#5️⃣-pubsub)

```
$redis->publish('news', 'Breaking News: PHP is awesome!');
$redis->subscribe('news', function ($redis, $channel, $message) {
    echo "Received on $channel: $message";
});
```

### 6️⃣ Transactions

[](#6️⃣-transactions)

```
$redis->transaction(function ($tx) {
    $tx->set('balance', 1000);
    $tx->incrBy('balance', 500);
});
```

📜 Full Feature List
-------------------

[](#-full-feature-list)

- **Basic Commands:** `insert()`, `update()`, `delete()`, `select()`, `select_all()`
- **Hashes:** `hash_insert()`, `hash_select()`, `hash_delete()`, `hash_select_all()`
- **Lists:** `push()`, `pop()`
- **Sets:** `set_add()`, `set_remove()`, `set_members()`
- **Sorted Sets:** `zadd()`, `zrem()`, `zrange()`, `zscore()`, etc.
- **Pub/Sub:** `publish()`, `subscribe()`
- **Expirations:** `set_expiration()`, `get_ttl()`
- **Transactions:** `transaction()`
- **Pipelines:** `pipeline()`
- **Scripting:** `eval()`, `evalsha()`
- **Streams:** `xadd()`, `xread()`, `xdel()`

🛠️ Contributing
---------------

[](#️-contributing)

If you want to **improve the library**, feel free to:

- Fork the repo
- Create a feature branch
- Submit a pull request

📜 License
---------

[](#-license)

This project is **open-source** and released under the **MIT License**.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance46

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

410d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a73a275ba6b41ff438f34f3b56078464b15e30df1e07975aff3e543727c52d74?d=identicon)[Smithkruz](/maintainers/Smithkruz)

---

Top Contributors

[![samsmithKruz](https://avatars.githubusercontent.com/u/85261000?v=4)](https://github.com/samsmithKruz "samsmithKruz (22 commits)")

---

Tags

phpclientredisredis clientredis wrapper

### Embed Badge

![Health badge](/badges/samsmithkruz-redis-client-class/health.svg)

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

###  Alternatives

[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[swoft/redis

swoft redis component

12168.4k16](/packages/swoft-redis)[eftec/cacheone

A Cache library with minimum dependency

103.5k4](/packages/eftec-cacheone)

PHPackages © 2026

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