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

ActiveSymfony-bundle[Caching](/categories/caching)

m6web/redis-bundle
==================

bundle sf on top of predis

v7.0.1(3y ago)8345.3k↓31.8%8PHPPHP &gt;=8.0

Since Mar 14Pushed 3y ago46 watchersCompare

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

READMEChangelog (10)Dependencies (15)Versions (56)Used By (0)

RedisBundle
===========

[](#redisbundle)

[![Build Status](https://github.com/BedrockStreaming/RedisBundle/actions/workflows/ci.yml/badge.svg)](https://github.com/BedrockStreaming/RedisBundle/actions/workflows/ci.yml) [![Latest Stable Version](https://camo.githubusercontent.com/87fb3d475501df02e5638d9efa8974ceac08af886766357d5f549d16f0d1363d/687474703a2f2f706f7365722e707567782e6f72672f6d367765622f72656469732d62756e646c652f76)](https://packagist.org/packages/m6web/redis-bundle) [![Total Downloads](https://camo.githubusercontent.com/37de553e4030ac1369cdff448715e056d47145a487289e4c3c433693b02cf5ec/687474703a2f2f706f7365722e707567782e6f72672f6d367765622f72656469732d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/m6web/redis-bundle) [![License](https://camo.githubusercontent.com/6cea96f55428a1364cad71e2b6acbf09870c6d1c3bbab57ad9d368841d5ded2a/687474703a2f2f706f7365722e707567782e6f72672f6d367765622f72656469732d62756e646c652f6c6963656e7365)](https://packagist.org/packages/m6web/redis-bundle) [![PHP Version Require](https://camo.githubusercontent.com/794338407d283fce45c4fe34b0bf67c3c2b74c143568d5954c5409c2beb5e158/687474703a2f2f706f7365722e707567782e6f72672f6d367765622f72656469732d62756e646c652f726571756972652f706870)](https://packagist.org/packages/m6web/redis-bundle)

symfony Bundle on top of predis

see [predis/predis](https://github.com/predis/predis)

features
--------

[](#features)

- semantic configuration
- sf event dispatcher integration
- session handler with redis storage : `M6Web\Bundle\RedisBundle\Redis\RedisSessionHandler`
- redis adapter for guzzle cache : `M6Web\Bundle\RedisBundle\Guzzle\RedisCacheAdapter`
- dataCollector for sf2 web profiler toolbar

usage
-----

[](#usage)

### configuration

[](#configuration)

in `config.yml` for a simple cache service :

```
m6web_redis:
    servers:
        default:
            host:   'localhost'
            port: 6379
            reconnect: 1
    clients:
        default:
            servers:   ["default"]     # list of servers to use
            prefix:    raoul\          # prefix to use
            timeout:   2               # timeout in second
            read_write_timeout: 2      # read-write timeout in second

```

for a multiple clients :

```
m6web_redis:
    servers:
        first:
            host:   'localhost'
            port: 6379
            reconnect: 1
        second:
            host:   'xxxxxxxx'
    clients:
        default:
            servers:   ["first"]     # list of servers to use
            prefix: raoul\           # prefix to use
            timeout:   2             # timeout in second (float)
            read_write_timeout: 1.2  # read write timeout in seconds (float)
            compress: true           # compress/uncompress data sent/retrieved from redis using gzip, only method SET, SETEX, SETNX, GET, MGET and MSET are supported
        sharded:
            servers: ["first", "second"]
            prefix: raaaoul\
            timeout:   1

```

`$this->get('m6web_redis')` send the default client. `this->get('m6web_redis.sharded')` the sharded one.

### list of options in servers configuration

[](#list-of-options-in-servers-configuration)

- *host*: IP address or hostname of Redis.
- *port*: CP port on which Redis is listening to. Default value 6379
- *database*: Database index (see the SELECT command).
- *scheme*: Connection scheme, such as 'tcp' or 'unix'. Default value tcp
- *async\_connect*: Performs the connect() operation asynchronously. Default value false
- *persistent*: Leaves the connection open after a GC collection. Default value false
- *timeout*: Timeout for the connect() operation. Default value 10
- *read\_write\_timeout*: Timeout for read() and write() operations
- *reconnect*: Number of reconnection attempt if a redis command fail, only for tcp

```
m6web_redis:
    servers:
        server1:
            host:   'localhost'
            port: 6379

```

### server configuration via wildcard

[](#server-configuration-via-wildcard)

```
m6web_redis:
    servers:
        server1:
            host:   'localhost'
            port: 6379
        server2:
            host:   'xxxxxxxx'
    clients:
        default:
            servers:   ["server*"]     # all servers matching server*
            prefix: raoul\
            timeout:   2

```

### event dispatcher

[](#event-dispatcher)

The event `M6Web\Bundle\RedisBundle\EventDispatcher\RedisEvent` is automaticly dispatched when a command is executed. Events are fired with the `redis.command` label.

You can customize the event name through the client configuration :

```
m6web_redis:
   clients:
       default:
           eventname: myEventName
```

### session handler

[](#session-handler)

```
# app/config/config.yml
framework:
  session:
    # ...
    handler_id: session.handler.redis

m6web_redis:
  servers:
    first:
      ip: 'localhost'
      port: 6379
  clients:
    sessions:
      servers: ["first"]
      prefix: sessions\
      timeout: 1

services:
  session.handler.redis:
    class: M6Web\Bundle\RedisBundle\Redis\RedisSessionHandler
    public:    false
    arguments:
      - '@m6web_redis.sessions'
      - 3600

```

### dataCollector

[](#datacollector)

Datacollector is available when the Symfony profiler is enabled. The collector allow you to see the following Redis data:

- Command name
- Execution time
- Command arguments

### overwriting base class

[](#overwriting-base-class)

```
m6web_redis:
    clients:
        default:
            servers: ["first"]
            type: ["db"]
            timeout: 0.5
            class: \MyCompany\Redis

```

#### guzzle redis cache adapter

[](#guzzle-redis-cache-adapter)

```
m6web_redis:
  clients:
    guzzlehttp:
      servers: ["first"]
      prefix: GuzzleHttp\
      class: M6Web\Bundle\RedisBundle\CacheAdapters\M6WebGuzzleHttp
      timeout: 1
```

Launch Unit Tests
-----------------

[](#launch-unit-tests)

```
bin/atoum
```

Launch php cs
-------------

[](#launch-php-cs)

```
    make cs-ci
    make cs-fix
```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~62 days

Recently: every ~52 days

Total

49

Last Release

1457d ago

Major Versions

v2.5.0 → v3.0.02017-07-31

v3.0.0 → v4.0.02018-02-01

v3.0.1 → v5.0.02020-01-27

v5.0.2 → v6.0.02021-07-08

v6.3.0 → v7.0.02022-04-29

PHP version history (7 changes)v1.0.0PHP &gt;=5.4

v2.2.0PHP &gt;=5.5

v3.0.0PHP &gt;=7.0

v4.0.0PHP &gt;=7.1

v6.0.0PHP ^7.2.5

v6.1.0PHP ^7.4

v7.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2069361?v=4)[Patrick](/maintainers/Bedrock)[@Bedrock](https://github.com/Bedrock)

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

---

Top Contributors

[![omansour](https://avatars.githubusercontent.com/u/1131098?v=4)](https://github.com/omansour "omansour (22 commits)")[![hdetang](https://avatars.githubusercontent.com/u/93374225?v=4)](https://github.com/hdetang "hdetang (8 commits)")[![lnahiro](https://avatars.githubusercontent.com/u/14995154?v=4)](https://github.com/lnahiro "lnahiro (4 commits)")[![mikaelrandy](https://avatars.githubusercontent.com/u/187703?v=4)](https://github.com/mikaelrandy "mikaelrandy (4 commits)")[![DocRoms](https://avatars.githubusercontent.com/u/12815769?v=4)](https://github.com/DocRoms "DocRoms (3 commits)")[![mojoLyon](https://avatars.githubusercontent.com/u/797786?v=4)](https://github.com/mojoLyon "mojoLyon (2 commits)")[![qdurillon-dev](https://avatars.githubusercontent.com/u/10450630?v=4)](https://github.com/qdurillon-dev "qdurillon-dev (2 commits)")[![fabdsp](https://avatars.githubusercontent.com/u/5878620?v=4)](https://github.com/fabdsp "fabdsp (2 commits)")[![Oliboy50](https://avatars.githubusercontent.com/u/2571084?v=4)](https://github.com/Oliboy50 "Oliboy50 (2 commits)")[![valentin-claras](https://avatars.githubusercontent.com/u/4446791?v=4)](https://github.com/valentin-claras "valentin-claras (1 commits)")[![COil](https://avatars.githubusercontent.com/u/177844?v=4)](https://github.com/COil "COil (1 commits)")[![kronostof](https://avatars.githubusercontent.com/u/5948812?v=4)](https://github.com/kronostof "kronostof (1 commits)")[![Stax](https://avatars.githubusercontent.com/u/1269657?v=4)](https://github.com/Stax "Stax (1 commits)")[![agallou](https://avatars.githubusercontent.com/u/320372?v=4)](https://github.com/agallou "agallou (1 commits)")

---

Tags

phpredissymfony2-bundle

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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