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

ActiveLibrary[Caching](/categories/caching)

kozz/static-cache
=================

Static Cache

0.1(11y ago)098MITPHPPHP &gt;=5.4.0

Since Feb 17Pushed 11y ago1 watchersCompare

[ Source](https://github.com/urakozz/php-static-cache)[ Packagist](https://packagist.org/packages/kozz/static-cache)[ Docs](http://github.com/urakozz/php-static-cache)[ RSS](/packages/kozz-static-cache/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Static Cache
============

[](#static-cache)

[![Build Status](https://camo.githubusercontent.com/e7ce03d2f13f4501608ed1b42952f367d2ff8bec583a14be8088ba8c957d431f/68747470733a2f2f7472617669732d63692e6f72672f7572616b6f7a7a2f7068702d7374617469632d63616368652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/urakozz/php-static-cache)[![Coverage Status](https://camo.githubusercontent.com/c6a974d336f4290e781c72e403611685d947277fe1cbf685cbf8e12cad4a011e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7572616b6f7a7a2f7068702d7374617469632d63616368652f62616467652e706e67)](https://coveralls.io/r/urakozz/php-static-cache)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5e992e84f652bf43c89754b6ab2d4e3614e3a54af866705743ef49b3c002d26b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7572616b6f7a7a2f7068702d7374617469632d63616368652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/urakozz/php-static-cache/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/9b54cc0b9ddf34284a94f20e7297e2429ccdb4b43c9377b880896ad02f30e456/68747470733a2f2f706f7365722e707567782e6f72672f6b6f7a7a2f7374617469632d63616368652f762f737461626c652e737667)](https://packagist.org/packages/kozz/static-cache)[![Latest Unstable Version](https://camo.githubusercontent.com/4afd23ad08ee986b79953c977536354c9d5b52ced2231692e06557020d066613/68747470733a2f2f706f7365722e707567782e6f72672f6b6f7a7a2f7374617469632d63616368652f762f756e737461626c652e737667)](https://packagist.org/packages/kozz/static-cache)[![License](https://camo.githubusercontent.com/60862b5f27c46815bc0a5a2947b00edd9d339e7d7b95f10235097e4c10166085/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b6f7a7a2f7374617469632d63616368652e737667)](https://packagist.org/packages/kozz/static-cache)

Static Cache with Repositories

### About

[](#about)

You can use `StaticCache` as simple cache tool that allows you access cached data from every place of your application during runtime.

It doesn't stores data im memcached or some other data storage, that's just static implementation of Doctrine's `ArrayCache`

The most powerful idea of this library is `Repositories`

### Repositories

[](#repositories)

Repository allows you initialize some heavy library once and than it's instance with simple Object-Oriented Style

E.g.: Assume are using Symfony Validator several times during the runtime. That's bad idea initialize it every time in different places of the application so you can easyly create SymfonyValidator Repository:

```
//SymfonyValidator.php

class SymfonyValidator implements CacheRepositoryInterface
{

  public funcnction getSingleton()
  {
    return Validation::createValidatorBuilder()
      ->enableAnnotationMapping(new CachedReader(new AnnotationReader(), new ArrayCache()))
      ->setMetadataCache(new DoctrineCache(new ArrayCache()))
      ->getValidator();
  }
}
```

//SomeFile.php use Kozz\\Components\\Cache\\StaticCache

$validator = StaticCache::loadRepository(new SymfonyValidator()); //Validator initialized and saved in cache

//SomeOtherFile.php use Kozz\\Components\\Cache\\StaticCache

$validator = StaticCache::loadRepository(new SymfonyValidator()); //Now validator just loaded from cache

```

### Reference

Methods

```get($id)``` - get

```set($id, $data)``` - set

```has($id)``` - check

```loadRepository(CacheRepositoryInterface $repository)``` - load Repository

```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

4153d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f78e5a1e5128b31ba7dfedcc9a3ccfbc4852f5df1b79a54867aa377169968a1?d=identicon)[urakozz](/maintainers/urakozz)

---

Top Contributors

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

---

Tags

cachestatic

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[contao-community-alliance/dc-general

Universal data container for Contao

1680.8k92](/packages/contao-community-alliance-dc-general)

PHPackages © 2026

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