symfony/symfony — pull request #3211 by beberlei (2012-01-29 15:39:54+00:00)
Title: [WIP] Cache Component

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: GH-1513

This addresses GH-1513, implementing a Caching interface as new Symfony Component.

It also ships a very simple ApcCache implementation, however the focus should be on just having the CacheInterface and let others provide more complex implementations and management. With the interface however everyone can rely on a common API in their Symfony bundles and applications.

As an example a cache delegate implementation has been provided for both Validator and ClassLoader components.

This is just the first step. A second step would be integration into FrameworkBundle with a section:

framework:
cache:
name:
provider: symfony.cache.apc

Integration points would be the provider (expecting a service id) and an options key, so we could have:

framework:
cache:
name:
provider: doctrine.common.cache.apc
options:
prefix: my_cache_prefix

The first cache provider in the list should also be aliased to "cache", so that all bundles can always trust on "cache" being available as service.