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

ActiveCamoo-plugin[Caching](/categories/caching)

camoo/cache
===========

Cache System Library

2.3.1(2y ago)01.6k1GPL-2.0-or-laterPHPPHP &gt;=8.2

Since Sep 13Pushed 2y ago1 watchersCompare

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

READMEChangelog (8)Dependencies (5)Versions (10)Used By (1)

Camoo Cache
===========

[](#camoo-cache)

A flexible caching library for PHP, supporting both FileSystem and Redis storage options with optional encryption capabilities.

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

[](#installation)

Install the package via Composer:

```
composer require camoo/cache
```

Configuration
=============

[](#configuration)

Before using Camoo Cache, you need to configure it based on your caching strategy and security preferences.

Generating a Crypto Salt (Optional)
-----------------------------------

[](#generating-a-crypto-salt-optional)

For encryption, generate a random crypto salt and save it securely, e.g., in an environment variable:

```
use Defuse\Crypto\Key;

$key = Key::createNewRandomKey();
$salt = $key->saveToAsciiSafeString();
```

Basic Usage
-----------

[](#basic-usage)

Import and configure the cache system, then read and write data:

```
use Camoo\Cache\Cache;
use Camoo\Cache\CacheConfig;

// Configuration for using FileSystem with encryption
$config = CacheConfig::fromArray([
    'duration' => 3600, // Cache duration in seconds
    'crypto_salt' => $salt, // Use the generated salt for encryption
    'encrypt' => true, // Enable encryption
]);

// Configuration for using FileSystem without encryption
$configNoEncrypt = CacheConfig::fromArray([
    'duration' => '+2 weeks', // Relative format supported
    'encrypt' => false,
]);

$cache = new Cache($config);

// Writing data to the cache
$cache->write('foo', 'bar');

// Reading data from the cache
$value = $cache->read('foo');
```

Using Redis as a Cache Backend
------------------------------

[](#using-redis-as-a-cache-backend)

To use Redis, specify `RedisEngine` as the class name and provide Redis-specific configurations:

```
$configRedis = CacheConfig::fromArray([
    'className' => \Camoo\Cache\RedisEngine::class, // Specify Redis engine
    'duration' => 3600, // TTL for cache entries
    'crypto_salt' => $salt, // Optional: for encrypted cache
    'encrypt' => true, // Enable encryption
    'server' => '127.0.0.1', // Redis server address
    'port' => 6379, // Redis server port
    'password' => 'foobar', // Redis password if required
    'database' => 0 // Redis database index
]);

$cacheRedis = new Cache($configRedis);

// Writing data to Redis
$cacheRedis->write('foo', 'data');

// Reading data from Redis
$data = $cacheRedis->read('foo');
```

Advanced Configuration
======================

[](#advanced-configuration)

Camoo Cache can be tailored with various settings, including namespace management, prefixing keys, and adjusting the underlying adapter's options. Consult the full configuration options in the `\Camoo\Cache\CacheConfig` class for more details.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity69

Established project with proven stability

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

Recently: every ~0 days

Total

8

Last Release

755d ago

Major Versions

1.0 → 2.02022-09-16

PHP version history (4 changes)1.0PHP &gt;=7.3

2.0PHP &gt;=8.0

2.2PHP &gt;=8.1

2.3.0PHP &gt;=8.2

### Community

Maintainers

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

---

Top Contributors

[![camoo](https://avatars.githubusercontent.com/u/24289021?v=4)](https://github.com/camoo "camoo (16 commits)")

---

Tags

CAMOOcache system

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/camoo-cache/health.svg)](https://phpackages.com/packages/camoo-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)[neos/cache

Neos Cache Framework

102.0M31](/packages/neos-cache)[graham-campbell/bounded-cache

A Bounded TTL PSR-16 Cache Implementation

101.9M6](/packages/graham-campbell-bounded-cache)[rikudou/psr6-dynamo-db-bundle

PSR-6 and PSR-16 cache implementation using AWS DynamoDB for Symfony

2077.8k](/packages/rikudou-psr6-dynamo-db-bundle)[infocyph/intermix

A Collection of useful PHP class functions.

136.4k1](/packages/infocyph-intermix)

PHPackages © 2026

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