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

ActiveLibrary[Caching](/categories/caching)

cscfa/cache-system-bundle
=========================

The CacheSystemBundle allow to store informations files into the application cache directory and automatically manage the out of date values

1251PHP

Since Dec 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/cscfa/CacheSystemBundle)[ Packagist](https://packagist.org/packages/cscfa/cache-system-bundle)[ RSS](/packages/cscfa-cache-system-bundle/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)DependenciesVersions (1)Used By (1)

CacheSystemBundle
=================

[](#cachesystembundle)

### Version 1.0.1-dev

[](#version-101-dev)

The cscfa caching system tool allow to store informations files into the application cache directory and automatically manage the out of date values.

\#####Installation

Register the bundle into app/appKernel.php

```
// app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            [...]
            new Cscfa\Bundle\CacheSystemBundle\CscfaCacheSystemBundle(),
        );

        [...]
    }
}

```

\#####Use manager

The cache manager allow to process a cache storage by using a closure. It will automatically use cache if exist, or create it with the closure result.

```
// in controller

	return new Response($this->get("cscfa_cache_system_manager")->process("id@key", function($controller, $name){
		return $controller->renderView("AcmeDemoBundle:Default:index.html.twig", array("name"=>$name));
	}, $this, $name));

```

\#####Getting cache

The main cache system is registered as a service into the 'cscfa\_cache\_system\_cache' id. It's used to get the cache provider.

The provider returned by the cache object implements the CacheProviderInterface and is intanciated with the configuration 'cscfa\_cache\_system.provider' parameter. Note that a filesystem provider is set by default.

```
// in controller

	//Cscfa\Bundle\CacheSystemBundle\Object\Cache
	$cache = $this->get("cscfa_cache_system_cache");

	//Cscfa\Bundle\CacheSystemBundle\Object\provider\CacheProviderInterface
	$provider = $cache->getProvider();

```

\#####Use the cache

The cache use a cache id to select a collection of cache elements. Each elements can be selected by their keys. This elements have a content and an out of date element.

The deletion of the elements on out of time case is done automatically during the retreiving of the cache collection.

```
	//Cscfa\Bundle\CacheSystemBundle\Object\Element\CacheCollection
	$collection = $provider->get("cacheId");

	// create a cache key with a content :
	$collection->create("20151216", "cache key creation");

	if ($collection->has("20151216")) {
		//Cscfa\Bundle\CacheSystemBundle\Object\Element\CacheElement
		$element = $collection->get("20151216");
	}

	// persist cache collection
	$provider->save($collection);

	/*
	 * note the element is soft removed as long as 'save' is not called
	 * and it will be returned at the next get('id') request
	 * (while the out of time is not reached)
	 */
	$collection->rem("20151216");

```

\#####Configure the bundle

The config file can be write as the follow :

```
// app/config

cscfa_cache_system:
	provider:  'provider complete class (Cscfa\Bundle\CacheSystemBundle\Object\provider\FileSystemCache as default)'
	prefix:    'string (null as default)'
	timestamp: integer (null as default)

```

The 'provider' indicate the provider class to use. Everyone class implementing CacheProviderInterface can be used.

The 'prefix' indicate a cache prefix. The usage of this depend of the provider. By example, the FileSystemCache use it to define a specific repository into the cache directory.

The 'timestamp' indicate the number of second before unvalidate the cache element.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12436206?v=4)[cscfa](/maintainers/cscfa)[@cscfa](https://github.com/cscfa)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[beryllium/cachebundle

Provides an interface to Memcache for Symfony2 applications

32136.0k](/packages/beryllium-cachebundle)

PHPackages © 2026

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