PHPackages                             rnr1721/le7-cache-memcache - 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. [Framework](/categories/framework)
4. /
5. rnr1721/le7-cache-memcache

ActiveLibrary[Framework](/categories/framework)

rnr1721/le7-cache-memcache
==========================

PSR-16 Memcache adapter for Le7 framework or any other PHP projects

1.0.6(2y ago)07MITPHPPHP &gt;=8.1

Since Mar 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/rnr1721/le7-cache-memcache)[ Packagist](https://packagist.org/packages/rnr1721/le7-cache-memcache)[ RSS](/packages/rnr1721-le7-cache-memcache/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

Memcache and memcached apapters for rnr1721/le7-cache
=====================================================

[](#memcache-and-memcached-apapters-for-rnr1721le7-cache)

It make enable to use memcache or memcached with le7-framework or any PHP project

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

[](#requirements)

- PHP 8.1 or higher.
- Composer 2.0 or higher.

What it can?
------------

[](#what-it-can)

- Standard implementation of PSR-16 Simple Cache
- Out of the box can use Filesystem, memory and session adapters
- Use memcache and memcached for caching

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

[](#installation)

```
composer require rnr1721/le7-cache-memcache
```

Testing
-------

[](#testing)

```
composer test
```

How it works?
-------------

[](#how-it-works)

```
use Core\Cache\SCFactoryMemcacheGeneric;

$cacheFactory = new SCFactoryMemcacheGeneric();

// For memcache
$cache = $cacheFactory->getMemcache("127.0.0.1", 11211);
// For memcached
$cache = $cacheFactory->getMemcached("127.0.0.1", 11211);

$data = [
    'value1' => 'The 1 value',
    'value2' => 'The 2 value'
    ];

// Put data in cache
// Set cache key, value and time-to-live
$cache->set('mykey', $data, 5000);

// Get value from cache
$result = $cache->get('mykey');

print_r($result);
```

implemented methods
-------------------

[](#implemented-methods)

```
use Psr\SimpleCache\CacheInterface;

    public function get(string $key, mixed $default = null): mixed;

    public function set(string $key, mixed $value, null|int|DateInterval $ttl = null): bool;

    public function delete(string $key): bool;

    public function clear(): bool;

    public function getMultiple(iterable $keys, mixed $default = null): iterable;

    public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool;

    public function deleteMultiple(iterable $keys): bool;

    public function has(string $key): bool;
```

factory methods
---------------

[](#factory-methods)

```
use Core\Cache\Interfaces\SCFactoryMemcache;

    /**
     * Get memcache instance of SimpleCache
     * @param string $host Memcache host
     * @param int $port Memcache port
     * @return CacheInterface
     */
    public function getMemcache(string $host = "127.0.0.1", int $port = 11211): CacheInterface;

    /**
     * Get memcached instance of SimpleCache
     * @param string $host Memcached host
     * @param int $port Memcached port
     * @return CacheInterface
     */
    public function getMemcached(string $host = "127.0.0.1", int $port = 11211): CacheInterface;
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Total

6

Last Release

1085d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

frameworkmemcachedviewcomponentmemcachele7le7-framework

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rnr1721-le7-cache-memcache/health.svg)

```
[![Health](https://phpackages.com/badges/rnr1721-le7-cache-memcache/health.svg)](https://phpackages.com/packages/rnr1721-le7-cache-memcache)
```

PHPackages © 2026

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