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.7k1GPL-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 today

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 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

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

801d 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

[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k17.8k](/packages/prestashop-prestashop)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)

PHPackages © 2026

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