Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added docs for ProxyAdapter
  • Loading branch information
javiereguiluz committed Apr 27, 2016
commit c44b7c258e1c9d5e51ca0db2720fb207e5d5e04a
16 changes: 15 additions & 1 deletion components/cache/cache_pools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,21 @@ lifetime applied to those cache items (by default it's ``0``).
Proxy Cache Adapter
~~~~~~~~~~~~~~~~~~~

.. TODO: what is this adapter useful for?
This adapter is useful to integrate in your application cache pools not created
with the Symfony Cache component. As long as those cache pools implement the
``CacheItemPoolInterface`` interface, this adapter allows you to get items from
that external cache and save them in the Symfony cache of your application::

use Symfony\Component\Cache\Adapter\ProxyAdapter;

// ... create $nonSymfonyCache somehow
$cache = new ProxyAdapter($nonSymfonyCache);

The adapter accepts two additional optional arguments: the namespace (``''`` by
default) and the default lifetime (``0`` by default).

Another use case for this adapter is to get statistics and metrics about the
cache hits and misses thanks to the ``getHits()`` and ``getMisses()`` methods.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"thanks to [...]" can be removed imo


Doctrine Cache Adapter
~~~~~~~~~~~~~~~~~~~~~~
Expand Down