PHPackages                             kozz/yii-doctrine-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. [Database &amp; ORM](/categories/database)
4. /
5. kozz/yii-doctrine-cache

ActiveLibrary[Database &amp; ORM](/categories/database)

kozz/yii-doctrine-cache
=======================

Doctrine Cache Factory for Yii 1

1.0.0(11y ago)15.0kMITPHPPHP &gt;=5.4.0

Since Jan 31Pushed 10y ago2 watchersCompare

[ Source](https://github.com/urakozz/php-yii-doctrine-cache)[ Packagist](https://packagist.org/packages/kozz/yii-doctrine-cache)[ Docs](http://github.com/urakozz/php-yii-doctrine-cache)[ RSS](/packages/kozz-yii-doctrine-cache/feed)WikiDiscussions master Synced 1mo ago

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

Yii1 Doctrine Cache
===================

[](#yii1-doctrine-cache)

[![Build Status](https://camo.githubusercontent.com/a696477b817ee54b662f272f3794d95d36508a104c5f117fc3cf2413eaee608a/68747470733a2f2f7472617669732d63692e6f72672f7572616b6f7a7a2f7068702d7969692d646f637472696e652d63616368652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/urakozz/php-yii-doctrine-cache)[![Coverage Status](https://camo.githubusercontent.com/374533959856287607adda8699ef75f65f6a8516159fbae873058586e5687a3e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7572616b6f7a7a2f7068702d7969692d646f637472696e652d63616368652f62616467652e706e67)](https://coveralls.io/r/urakozz/php-yii-doctrine-cache)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/556a8f227772d24991f534957dfa2d76df5b1333d5eded5cb2dcaa5237680e46/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7572616b6f7a7a2f7068702d7969692d646f637472696e652d63616368652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/urakozz/php-yii-doctrine-cache/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/b466149f055422c7e4d72b7e53a34813cd844f8e7bd945ec6ba5f3a02c250fec/68747470733a2f2f706f7365722e707567782e6f72672f6b6f7a7a2f7969692d646f637472696e652d63616368652f762f737461626c652e737667)](https://packagist.org/packages/kozz/yii-doctrine-cache)[![Latest Unstable Version](https://camo.githubusercontent.com/c4ee119cd4b610745fd0544522f46fb5e7d3f6a38b4cf61df56a8f33146a9766/68747470733a2f2f706f7365722e707567782e6f72672f6b6f7a7a2f7969692d646f637472696e652d63616368652f762f756e737461626c652e737667)](https://packagist.org/packages/kozz/yii-doctrine-cache)[![License](https://camo.githubusercontent.com/a01fc12ecabce69ecda0f2e31e08afe353b0b6680c3fb7ab906b50f8492d2755/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b6f7a7a2f7969692d646f637472696e652d63616368652e737667)](https://packagist.org/packages/kozz/yii-doctrine-cache)

Proxy for Doctrine Cache in Yii

### When to use

[](#when-to-use)

`YiiDoctrineCache` implements `Doctrine\Common\Cache\Cache` interface so it's fully compatible with all libraries that are requiring Doctrine Cache such as:

- Doctrine Annotation Reader
- Symfony Validator
- JMS Serializer

### How does it works

[](#how-does-it-works)

`YiiDoctrineCache` loads the most suitable Doctrine Cache Implementation in dependency of Yii Cache configuration:

- `Doctrine\Common\Cache\MemcachedCache`
- `Doctrine\Common\Cache\MemcacheCache`
- `Doctrine\Common\Cache\ArrayCache`

### Advantages

[](#advantages)

`YiiDoctrineCache` uses Proxy design pattern under the hood so you always have the same instance of Cache every time you call `new YiiDoctrineCache()`even if Doctrine's `ArrayCache` selected

```
//SomeFile.php
use Kozz\Yii1\Cache\YiiDoctrineCache;

$cache = new YiiDoctrineCache();
$cache->save('id', 'value');

//SomeOtherFile.php
use Kozz\Yii1\Cache\YiiDoctrineCache;

$cache = new YiiDoctrineCache();
$cache->fetch('id'); // 'value'
```

### Reference

[](#reference)

Methods

`fetch($id)` - Fetches an entry from the cache

`contains($id)` - Test if an entry exists in the cache

`save($id, $data, $lifeTime = false)` - Puts data into the cache

`delete($id)` - Deletes a cache entry

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

4119d 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 (5 commits)")

---

Tags

doctrinecacheyiiYii1

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[cache/doctrine-adapter

A PSR-6 cache implementation using Doctrine. This implementation supports tags

151.0M21](/packages/cache-doctrine-adapter)[cache/psr-6-doctrine-bridge

PSR-6 Doctrine bridge

151.0M4](/packages/cache-psr-6-doctrine-bridge)[kdyby/doctrine-cache

Doctrine Cache bridge for Nette Framework

101.3M19](/packages/kdyby-doctrine-cache)

PHPackages © 2026

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