PHPackages                             zunnu/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. [Database &amp; ORM](/categories/database)
4. /
5. zunnu/redis

ActiveCakephp-plugin[Database &amp; ORM](/categories/database)

zunnu/redis
===========

CakePHP support for the Redis key-value database

1.1(2y ago)020.5k—3.1%MITPHP

Since Aug 19Pushed 2y agoCompare

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

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

A Redis connection adapter for CakePHP
======================================

[](#a-redis-connection-adapter-for-cakephp)

This library makes it possible to create connections for any Redis database that can be created and managed with CakePHP's `ConnectionManager`.

Redis is a great Key-Value database with excelent performance. It also offers several unique features for working with large lists, hashmaps and even pub-sub systems.

Connecting to the redis database
--------------------------------

[](#connecting-to-the-redis-database)

This library assumes that you either have installed `phpredis` or `predis`. We recommend installing `phpredis`

- [PhpRedis](https://github.com/phpredis/phpredis) (recommended)
- [Predis](https://github.com/nrk/predis)

### Configuring it in in your app.php file in

[](#configuring-it-in-in-your-appphp-file-in)

Just add any new named configuration under the `Datasources` key

```
    'Datasources' => [
        ...
        'redis' => [
            'className' => 'Cake\Redis\RedisConnection',
            'driver' => 'phpredis', // Can also use a full class name or 'predis'
            'log' => false, // Log executed commands
            'host' => '127.0.0.1',
            'port' => 6379,
            'timeout' => [optional],
            'reconnectionDelay' => [optional],
            'persistentId' => [optional],
            'database' => [optional],
            'options' => [], // extra options for the driver
        ]
    ]
```

### Using ConnectionManager

[](#using-connectionmanager)

You can also create new redis connections with the `ConnectionManger`

```
use Cake\Datasource\ConnectionManager;

ConnectionManager::config('redis', [
    'className' => 'Cake\Redis\RedisConnection',
    'driver' => 'Cake\Redis\Driver\PHPRedisDriver',
    'log' => false, // Log executed commands
    'host' => '127.0.0.1',
    'port' => 6379,
    'timeout' => [optional],
    'reconnectionDelay' => [optional],
    'persistentId' => [optional],
    'database' => [optional],
    'options' => [], // extra options for the driver
]);
```

Executing commands in Redis
---------------------------

[](#executing-commands-in-redis)

You need to get a hold of the connection and the execute commands:

```
$redis = ConnectionManager::get('redis');
$redis->set('cakephp', 'awesome');
echo $redis->get('cakephp'); // Returns 'awesome'
```

Make sure you take a look at all the commands you can run in the [PHPRedis Readme](https://github.com/phpredis/phpredis/blob/develop/README.markdown).

Executing a list of commands in a transaction
---------------------------------------------

[](#executing-a-list-of-commands-in-a-transaction)

```
$redis = ConnectionManager::get('redis');
$redis->transactional(function ($client) {
    $client
        ->set('cakephp', 'awesome')
        ->set('another_key', 'value')
});
```

The client instance the closure gets will buffer all the commands and execute them atomically at the end of the chain.

This method uses the `multi()` command internally.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~241 days

Total

3

Last Release

886d ago

Major Versions

1.0 → 3.x-dev2023-05-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/87be5ff062749fe4a745840ccf9921ca94a513983363abd7b925248f0c632769?d=identicon)[zunnu](/maintainers/zunnu)

---

Top Contributors

[![lorenzo](https://avatars.githubusercontent.com/u/37621?v=4)](https://github.com/lorenzo "lorenzo (9 commits)")[![Juanchimienti](https://avatars.githubusercontent.com/u/12194399?v=4)](https://github.com/Juanchimienti "Juanchimienti (4 commits)")[![zunnu](https://avatars.githubusercontent.com/u/7551907?v=4)](https://github.com/zunnu "zunnu (3 commits)")[![giboow](https://avatars.githubusercontent.com/u/1560862?v=4)](https://github.com/giboow "giboow (1 commits)")[![johanmeiring](https://avatars.githubusercontent.com/u/1214876?v=4)](https://github.com/johanmeiring "johanmeiring (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[robmorgan/phinx

Phinx makes it ridiculously easy to manage the database migrations for your PHP app.

4.5k46.2M405](/packages/robmorgan-phinx)[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)[usmanhalalit/laracsv

A Laravel package to easily generate CSV files from Eloquent model.

6151.7M4](/packages/usmanhalalit-laracsv)

PHPackages © 2026

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