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

Abandoned → [cache/cache-bundle](/?search=cache%2Fcache-bundle)Library[Caching](/categories/caching)

aequasi/cache-bundle
====================

Creates services in Symfony 2, for cache, that can also be used with doctrines three cache types. It also provides functionality for session handler support, and Router support.

3.0.2(10y ago)35152.7k↓50%14Apache v2PHPPHP ~5.3

Since Dec 10Pushed 7y ago8 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (42)Used By (0)

This Bundle is Deprecated
=========================

[](#this-bundle-is-deprecated)

This bundle has been replaced by [PHP-Cache](http://www.php-cache.com). Check it out!

Aequasi cache-bundle [![Build Status](https://camo.githubusercontent.com/70300d0cea8acf3cc8cb9f7830d46440b700618d9abd087aa102b93361c2f687/68747470733a2f2f7472617669732d63692e6f72672f616571756173692f63616368652d62756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/aequasi/cache-bundle)
================================================================================================================================================================================================================================================================================================================

[](#aequasi-cache-bundle-)

#### Cache Bundle for Symfony 2

[](#cache-bundle-for-symfony-2)

Creates services in Symfony 2, for cache, that can also be used with doctrines three cache types (metadata, result, and query). It also provides functionality for session handler support, and Router support.

The respective cache extensions will be required for your project.

Redis uses the php redis extension.

#### Requirements

[](#requirements)

- PHP &gt;= 5.6, &lt; 7.1
- Symfony &gt;= 2.7, &lt; 4.0
- [Composer](http://getcomposer.org)

#### To Install

[](#to-install)

Run the following in your project root, assuming you have composer set up for your project

```
composer.phar require aequasi/cache-bundle
```

Add the bundle to app/AppKernel.php

```
$bundles(
    ...
       new Aequasi\Bundle\CacheBundle\AequasiCacheBundle(),
    ...
);
```

Then add parameters (probably in config.yml) for your servers, and options

```
aequasi_cache:
    instances:
        default:
          persistent: true # Boolean or persistent_id
          namespace: mc
          type: memcached
          hosts:
              - { host: localhost, port: 11211 }
```

To see all the config options, run `php app/console config:dump-reference aequasi_cache` to view the config settings

#### Doctrine

[](#doctrine)

This bundle allows you to use its services for Doctrine's caching methods of metadata, result, and query.

If you want doctrine to use this as the result and query cache, add this

```
aequasi_cache:
    doctrine:
        enabled: true
        metadata:
            instance: default
            entity_managers:   [ default ]          # the name of your entity_manager connection
            document_managers: [ default ]       # the name of your document_manager connection
        result:
            instance: default
            entity_managers:   [ default, read ]  # you may specify multiple entity_managers
        query:
            instance: default
            entity_managers: [ default ]
```

#### Session

[](#session)

This bundle even allows you to store your session data in one of your cache clusters. To enable:

```
aequasi_cache:
    session:
        enabled: true
        instance: default
        prefix: "session_"
        ttl: 7200
```

#### Router

[](#router)

This bundle also provides router caching, to help speed that section up. To enable:

```
aequasi_cache:
    router:
        enabled: true
        instance: default
```

If you change any of your routes, you will need to clear all of the route\_\* keys in your cache.

#### To Use

[](#to-use)

To use this with doctrine's entity manager, just make sure you have `useResultCache` and/or `useQueryCache` set to true. If you want to use the user cache, just grab the service out of the container like so:

```
// Change default to the name of your instance
$cache = $container->get( 'aequasi_cache.instance.default' );
// Or
$cache = $container->get( 'aequasi_cache.default' );
```

Here is an example usage of the service:

```
$cache = $this->get( 'aequasi_cache.instance.default' );
$item = $cache->getItem('test');
if ($item->isHit()) {
	var_dump($item->get());

	return;
}

$cache->saveItem('test', $em->find('AcmeDemoBundle:User', 1), 3600);
```

### Need Help?

[](#need-help)

Create an issue if you've found a bug, or ping me on twitter: @aequasi

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 79.1% 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 ~15 days

Recently: every ~96 days

Total

40

Last Release

3946d ago

Major Versions

1.3.8 → 2.0.02014-01-21

2.4.0 → 3.0.02015-01-01

PHP version history (2 changes)1.0.2PHP &gt;=5.3.0

3.0.0PHP ~5.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/9cf67675d97e63f6ff9e7fed55f35502b24cd834081806a6731229117c0630bb?d=identicon)[aequasi](/maintainers/aequasi)

---

Top Contributors

[![cryptiklemur](https://avatars.githubusercontent.com/u/896295?v=4)](https://github.com/cryptiklemur "cryptiklemur (163 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (21 commits)")[![h4cc](https://avatars.githubusercontent.com/u/2981491?v=4)](https://github.com/h4cc "h4cc (9 commits)")[![Phobetor](https://avatars.githubusercontent.com/u/712973?v=4)](https://github.com/Phobetor "Phobetor (3 commits)")[![aeyoll](https://avatars.githubusercontent.com/u/1472285?v=4)](https://github.com/aeyoll "aeyoll (2 commits)")[![cdaguerre](https://avatars.githubusercontent.com/u/4642448?v=4)](https://github.com/cdaguerre "cdaguerre (2 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")[![cordoval](https://avatars.githubusercontent.com/u/328359?v=4)](https://github.com/cordoval "cordoval (1 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")[![volkan](https://avatars.githubusercontent.com/u/28885?v=4)](https://github.com/volkan "volkan (1 commits)")[![jeroenvdgulik](https://avatars.githubusercontent.com/u/242090?v=4)](https://github.com/jeroenvdgulik "jeroenvdgulik (1 commits)")

---

Tags

phprediscachememcached

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[tedivm/stash-bundle

Incorporates the Stash caching library into Symfony.

841.4M16](/packages/tedivm-stash-bundle)[robinn/phpcacheadmin

A web dashboard for your favorite caching system.

4441.1k1](/packages/robinn-phpcacheadmin)[alekseykorzun/memcached-wrapper-php

Optimized PHP 5 wrapper for Memcached extension that supports dog-piling, igbinary and local storage

2984.6k1](/packages/alekseykorzun-memcached-wrapper-php)[eftec/cacheone

A Cache library with minimum dependency

103.5k4](/packages/eftec-cacheone)

PHPackages © 2026

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