PHPackages                             exts/cathy - 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. exts/cathy

ActiveLibrary

exts/cathy
==========

Cache key generation library for allowing your caching system to support 'path/ing/keys' easily :)

1.0.0(3y ago)01.9k↓41.7%MITPHPPHP &gt;=7.3

Since Sep 21Pushed 3y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

Cathy
=====

[](#cathy)

example.php

```
class Cache
{
    private $cache;

    private $cathy;

    public function __construct(
        CacheDriverInterface $cache,
        Cathy $cathy = null
    ){
        $this->cache = $cache;
        $this->cathy = $cathy ?? new Cathy();
    }

    public function connect()
    {
        return $this->cache->connect();
    }

    public function get($key)
    {
        $keys = $this->cathy->generateKeysFromPath($key);
        return $this->cache->get(end($keys));
    }

    public function getRaw($key)
    {
        return $this->cache->get($key);
    }

    public function set($key, $data, $ttl = 0)
    {
        $keys = $this->cathy->generateKeysFromPath($key);
        $tree = $this->cathy->generateKeyTreeFromPath($key);

        // store data early if necessary
        $path = current($keys) . "-data";

        $cache_data = $tree;
        if($this->cache->exists($path)) {
            $cache_data = $this->getRaw($path);
            if(!empty($cache_data)) {
                try {
                    $cache_data = unserialize($cache_data);
                    $cache_data = $this->cathy->addKeysToTree($cache_data, $keys);
                } catch(\Exception $e) {
                    $cache_data = $tree;
                }
            }
        }

        // store cache tree data no timer
        $this->setRaw($path, serialize($cache_data));

        // store cache data
        return $this->setRaw(end($keys), $data, $ttl);
    }

    public function setRaw($key, $data, $ttl = 0)
    {
        return $this->cache->set($key, $data, $ttl);
    }

    public function remove($key)
    {
        $keys = $this->cathy->generateKeysFromPath($key);

        // store data early if necessary
        $path = current($keys) . "-data";

        $remove = $keys;

        // update root path key tree
        if($this->cache->exists($path)) {
            $cache_data = $this->getRaw($path);
            if(!empty($cache_data)) {
                try {
                    $cache_data = unserialize($cache_data);
                    $remove = $this->cathy->removeKeysFromTree($cache_data, $keys);
                    // store cache tree data no timer
                    $this->setRaw($path, serialize($cache_data));
                } catch(\Exception $e) {
                }
            }
        }

        // delete child keys from list
        foreach($remove as $k) {
            $this->removeRaw($k);
        }

        // delete last key in keys list
        $this->removeRaw(end($keys));
    }

    public function removeRaw($key)
    {
        return $this->cache->remove($key);
    }
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

1335d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d11ac939290fe178f8787292ce605375859d8c035fbd14c859bf827f069738b?d=identicon)[exts](/maintainers/exts)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/exts-cathy/health.svg)

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

PHPackages © 2026

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