PHPackages                             seworqs/commons-cache - 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. seworqs/commons-cache

ActiveLibrary[Caching](/categories/caching)

seworqs/commons-cache
=====================

A lightweight PSR-16 cache manager with multi-namespace support, configurable Symfony adapters, and TTL handling.

2.0.0(12mo ago)01Apache-2.0PHPPHP ^8.1

Since May 17Pushed 12mo agoCompare

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

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

SEworqs Commons Cache
=====================

[](#seworqs-commons-cache)

A lightweight PSR-16 cache manager with multi-namespace support, configurable Symfony adapters, and TTL handling.
Built on top of [symfony/cache](https://symfony.com/doc/current/components/cache.html), fully compatible with PHP 8.1+ and PSR standards.

---

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

[](#installation)

```
composer require seworqs/commons-cache
```

---

Basic Usage (stand-alone)
-------------------------

[](#basic-usage-stand-alone)

```
use Seworqs\Commons\Cache\CacheManagerFactory;

$config = [
    'namespaces' => [
        'default' => [
            'adapter' => 'array',
            'ttl' => 3600,
        ],
        'menu' => [
            'adapter' => 'filesystem',
            'ttl' => 600,
            'directory' => __DIR__ . '/cache/menu',
        ],
    ],
];

$manager = CacheManagerFactory::create($config);

$cache = $manager->getNamespace();
$cache->set('foo', 'bar');
$value = $cache->get('foo');
```

---

Adapter Options
---------------

[](#adapter-options)

You may use:

### ✅ Aliases:

[](#-aliases)

- `'array'`
- `'filesystem'`
- `'null'`

### ✅ Full class names:

[](#-full-class-names)

```
'adapter' => Symfony\Component\Cache\Adapter\PhpFilesAdapter::class
```

### ✅ Ready-to-use instances:

[](#-ready-to-use-instances)

```
'adapter' => new Symfony\Component\Cache\Adapter\RedisAdapter($redisClient, 'namespace', 600)
```

Other adapters like Redis, Memcached, or PDO can be used by providing their full class name and handling construction yourself.

---

Laminas Integration
-------------------

[](#laminas-integration)

```
'factories' => [
    Seworqs\Commons\Cache\CacheManagerInterface::class => Seworqs\Commons\Cache\CacheManagerFactory::class,
],
```

Use via dependency injection:

```
public function __construct(private CacheManagerInterface $cacheManager) {}
```

---

Testing
-------

[](#testing)

```
composer test
```

Runs PHPUnit using in-memory adapters.

---

License
-------

[](#license)

Apache-2.0, see [LICENSE](./LICENSE)

About SEworqs
-------------

[](#about-seworqs)

Seworqs builds clean, reusable modules for PHP and Mendix developers.

Learn more at [github.com/seworqs](https://github.com/seworqs)

Badges
------

[](#badges)

[![Latest Version](https://camo.githubusercontent.com/0d4f31941d3380ee9675f5e2288903e0915bec54b9ad84db636f56b3319c68ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7365776f7271732f636f6d6d6f6e732d63616368652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/seworqs/commons-cache)[![Total Downloads](https://camo.githubusercontent.com/fd609efe1de90d0b6877a23a31e312f00feb82a962ad019588fe7f3b7716f7e9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7365776f7271732f636f6d6d6f6e732d63616368652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/seworqs/lcommons-cache)[![License](https://camo.githubusercontent.com/369d9ee82efa467f5e448d005a57f5c79c9801439d3fca2b237e5bc6c83175ce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7365776f7271732f636f6d6d6f6e732d63616368653f7374796c653d666c61742d737175617265)](https://packagist.org/packages/seworqs/commons-cache)[![PHP Version](https://camo.githubusercontent.com/9ff817e1c6a2cbd7e3fe5d5d9db6ae0184f772ebda991776ea0cc859931a7564/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7365776f7271732f636f6d6d6f6e732d63616368652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/seworqs/commons-cache)[![Made by SEworqs](https://camo.githubusercontent.com/ad569c37484434025feef6c31328d15c4af36b07da451e39c4849e15a54e1e18/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d61646525323062792d5345776f7271732d3030326437343f7374796c653d666c61742d737175617265266c6f676f3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f7365776f7271732f636f6d6d6f6e732d63616368652f6d61696e2f6173736574732f6c6f676f2e737667266c6f676f436f6c6f723d7768697465)](https://github.com/seworqs)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance50

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

Total

2

Last Release

362d ago

Major Versions

1.0.0 → 2.0.02025-05-19

### Community

Maintainers

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

---

Top Contributors

[![seworqs-sefranke](https://avatars.githubusercontent.com/u/205894657?v=4)](https://github.com/seworqs-sefranke "seworqs-sefranke (4 commits)")

---

Tags

symfonylaminascachepsr-16namespacettlseworqs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/seworqs-commons-cache/health.svg)

```
[![Health](https://phpackages.com/badges/seworqs-commons-cache/health.svg)](https://phpackages.com/packages/seworqs-commons-cache)
```

###  Alternatives

[laminas/laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output

1076.9M130](/packages/laminas-laminas-cache)[webarchitect609/bitrix-cache

Comfortable fluent interface for Bitrix cache. Anti-stampede cache protection.

2831.2k8](/packages/webarchitect609-bitrix-cache)

PHPackages © 2026

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