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

AbandonedLibrary[Caching](/categories/caching)

initphp/redis
=============

InitPHP Redis Management (DEPRECATED — use the ext-redis extension directly, or initphp/cache / initphp/sessions for higher-level needs)

1.0.1(2mo ago)1121MITPHPPHP &gt;=7.4

Since Nov 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/InitPHP/Redis)[ Packagist](https://packagist.org/packages/initphp/redis)[ RSS](/packages/initphp-redis/feed)WikiDiscussions master Synced 1w ago

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

InitPHP Redis Management
------------------------

[](#initphp-redis-management)

> ## ⚠️ DEPRECATED — No Longer Maintained
>
> [](#️-deprecated--no-longer-maintained)
>
> This package was a thin convenience wrapper around the PHP `ext-redis` extension, adding prefix handling and automatic `serialize()` of values. As part of the InitPHP package consolidation, **it has been retired:**
>
> - **PHP 8+ ships `ext-redis` with fully typed methods**, so a wrapper adds little over the native API.
> - The automatic `serialize()` adds non-trivial CPU + network overhead and is rarely what callers want today.
> - No package in the InitPHP ecosystem currently depends on this one. (`initphp/cache` and `initphp/sessions` both talk to `\Redis` directly.)
>
> This repository is kept read-only for historical reference. **No further updates will be released.**
>
> ### What to use instead
>
> [](#what-to-use-instead)
>
> Pick the closest match to what you were doing:
>
> **Caching key/value data** — use [`initphp/cache`](https://github.com/InitPHP/Cache) with its bundled Redis handler:
>
> ```
> use InitPHP\Cache\Handler\Redis as RedisCache;
>
> $cache = new RedisCache([
>     'host' => '127.0.0.1',
>     'port' => 6379,
> ]);
> $cache->set('name', 'muhammet');
> ```
>
>
>
> **Storing session data** — use [`initphp/sessions`](https://github.com/InitPHP/Sessions) with its `RedisAdapter`. See the Sessions README for the Redis usage example.
>
> **Anything else** (Pub/Sub, Lua scripts, Cluster, pipelining, low-level Redis commands) — call `\Redis` directly. It is the canonical, fully-typed entry point and supports the full Redis feature surface:
>
> ```
> $redis = new \Redis();
> $redis->connect('127.0.0.1', 6379);
> $redis->set('name', 'muhammet');
> $value = $redis->get('name');
> ```
>
>
>
> Composer will surface this package as `abandoned` on `composer require`, `composer update`, and `composer outdated`.

---

This library was born to facilitate and customize the use of getter and setter of PHP and Redis.

Requirements
------------

[](#requirements)

- PHP 7.4 or later
- PHP Redis Extension

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

[](#installation)

```
composer require initphp/redis

```

Usage
-----

[](#usage)

```
require_once "vendor/autoload.php";
use \InitPHP\Redis\Redis;

// Provide your connection information;
$redis = new Redis([
        'prefix'        => 'i_',
        'host'          => '127.0.0.1',
        'password'      => null,
        'port'          => 6379,
        'timeout'       => 0,
        'database'      => 0,
]);

// Use Setter and Getter;
$redis->set('name', 'muhammet');
if($redis->has('name')){
    echo $redis->get('name'); // "muhammet"
}

/**
 * or tell the get method what it will
 * do if it can't find it,
 * or a default value it will return;
 */
echo $redis->get('username', 'Undefined'); // "Undefined"

echo $redis->get('surname', function () use ($redis) {
    $value = 'ŞAFAK';
    $redis->set('surname', $value);
    return $value;
}); // "ŞAFAK"
```

Credits
-------

[](#credits)

- [Muhammet ŞAFAK](https://www.muhammetsafak.com.tr) &lt;&gt;

License
-------

[](#license)

Copyright © 2022 [MIT License](./LICENSE)

###  Health Score

30

—

LowBetter than 61% of packages

Maintenance48

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

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

Total

2

Last Release

85d ago

### Community

Maintainers

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

---

Top Contributors

[![muhammetsafak](https://avatars.githubusercontent.com/u/104234499?v=4)](https://github.com/muhammetsafak "muhammetsafak (2 commits)")

### Embed Badge

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

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

###  Alternatives

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[phpfastcache/phpssdb

PHP SSDB Driver for phpFastCache

14736.9k1](/packages/phpfastcache-phpssdb)[rapidwebltd/rw-file-cache

RW File Cache is a PHP File-based Caching Library. Its syntax is designed to closely resemble the PHP memcache extension.

15196.8k7](/packages/rapidwebltd-rw-file-cache)[yuzuru-s/redis-recommend

Wrapping Redis's sorted set APIs for specializing recommending operations.

392.9k](/packages/yuzuru-s-redis-recommend)[ichhabrecht/intcache

Turn uncachable page objects into cacheable links

193.9k](/packages/ichhabrecht-intcache)

PHPackages © 2026

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