PHPackages                             composer-fallback/redis.predis - 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. composer-fallback/redis.predis

ActiveMetapackage[Caching](/categories/caching)

composer-fallback/redis.predis
==============================

Satisfy "redis" with packages provided by user, or fallback to "predis".

1.1(5y ago)0130MIT

Since Oct 2Pushed 5y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (3)Used By (0)

Fallback for `redis` using `predis`
===================================

[](#fallback-for-redis-using-predis)

Provides a metapackage for library needing `redis`that fallback to a default implementation when user does not meet the initial requirements.

Usage
-----

[](#usage)

```
composer require "composer-fallback/redis.predis:*"
```

Composer will, by preference:

- check if user has `ext-redis`
- otherwise, fallbacks to `predis/predis`

How does it works
-----------------

[](#how-does-it-works)

This package contains 2 versions:

1. The highest [1.1](https://github.com/composer-fallback/redis.predis/blob/1.1/composer.json) needs `ext-redis`.
2. The lowest [1.0](https://github.com/composer-fallback/redis.predis/blob/1.0/composer.json) triggers install of `predis/predis`.

Composer will choose this highest version when user has the extension ext-redis. Otherwise, composer will choose the lowest version and in that case will download the following packages: `predis/predis`.

What problem does it solve?
---------------------------

[](#what-problem-does-it-solve)

You are maintaining a library that need an implementation of `redis`, but you don't want requiring a specific implementation.

ie. you need function defined in `redis`, but polyfill exists and would be enough.

When end users requires you library with the following code

```
{
    "name": "end-user/app",
    "require": {
      "acme/lib": "^1.0"
    }
}
```

They probably ends with such error

```
composer up

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for acme/lib ^1.0 -> satisfiable by acme/lib[1.0].
    - acme/lib 1.0 requires ext-redis * -> no matching package found.
```

You can ask user to install a random package, it works, but the DX is very bad, and confusing at first.

By using `composer-fallback/redis.predis`, users will provide the native implementation or fallback to your default choice

### Example of user that meet the preferred requirements

[](#example-of-user-that-meet-the-preferred-requirements)

```
{
    "name": "end-user/app",
    "require": {
        "acme/lib": "^1.0",
        "third-party/provide-implementation": "^1.0"
    }
}
```

```
composer up
...
Package operations: 2 installs, 0 updates, 0 removals
  - Installing acme/lib (1.0)
  - Installing composer-fallback/redis.predis (1.1)
```

### Example of user that fallback to your recommendations

[](#example-of-user-that-fallback-to-your-recommendations)

```
{
    "name": "end-user/app",
    "require": {
        "acme/lib": "^1.0"
    }
}
```

```
composer up
...
Package operations: 3 installs, 0 updates, 0 removals
  - Installing acme/lib (1.0)
  - Installing composer-fallback/redis.predis (1.0)
  - Installing predis/predis (1.0)
```

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

[](#contributing)

This repository is automatically generated. If you want contributing and submitting an issue or a Pull Request, please use [composer-fallback/generator](https://github.com/composer-fallback/generator).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Every ~0 days

Total

2

Last Release

2046d ago

### Community

Maintainers

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

---

Top Contributors

[![jderusse](https://avatars.githubusercontent.com/u/578547?v=4)](https://github.com/jderusse "jderusse (3 commits)")

---

Tags

composerredisfallbackdefault

### Embed Badge

![Health badge](/badges/composer-fallback-redispredis/health.svg)

```
[![Health](https://phpackages.com/badges/composer-fallback-redispredis/health.svg)](https://phpackages.com/packages/composer-fallback-redispredis)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[clue/redis-protocol

A streaming Redis protocol (RESP) parser and serializer written in pure PHP.

5311.0M13](/packages/clue-redis-protocol)[rtcamp/nginx-helper

Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also provides cloudflare edge cache purging with Cache-Tags.

23817.0k1](/packages/rtcamp-nginx-helper)

PHPackages © 2026

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