Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the documentation for the Cache component #6515

Closed
wants to merge 23 commits into from
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

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
Updated the description of ChainAdapter
  • Loading branch information
javiereguiluz committed Apr 27, 2016

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 81ec9883d2eb2650396573ff031a969223152d58
4 changes: 2 additions & 2 deletions components/cache/cache_items.rst
Original file line number Diff line number Diff line change
@@ -24,8 +24,8 @@ numbers (0-9) and the ``_`` and ``.`` symbols. Other common symbols (such as
standard for future uses.

The **value** of a cache item can be any data represented by a type which is
serializable by PHP, such as basic types (strings, integers, floats, booleans,
null), arrays and objects.
serializable by PHP, such as basic types (string, integer, float, boolean, null),
arrays and objects.

Creating Cache Items
--------------------
12 changes: 6 additions & 6 deletions components/cache/cache_pools.rst
Original file line number Diff line number Diff line change
@@ -127,7 +127,7 @@ Chain Cache Adapter

This adapter allows to combine any number of the previous adapters. Cache items
are fetched from the first adapter which contains them. Besides, cache items are
saved in all the given adapters, so this is a quick way of creating a cache
saved in all the given adapters, so this is a simple way of creating a cache
replication::

use Symfony\Component\Cache\Adapter\ApcuAdapter;
@@ -139,11 +139,11 @@ replication::

$cache = new ChainAdapter(array($apcCache, $fileCache));

The second optional argument of ``ChainAdapter`` is the ``maxLifetime`` (default
``0``) which is the maximum lifetime of items propagated from lower adapters to
upper ones.

.. TODO: I don't understand the previous phrase, which is copied from the ChainAdapter code.
when an item is not found in the first adapters but is found in the next ones,
Copy link
Member

Choose a reason for hiding this comment

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

"When [...]"

the ``ChainAdapter`` ensures that the fetched item is saved in all the adapters
where it was missing. Since it's not possible to know the expiry date and time
of a cache item, the second optional argument of ``ChainAdapter`` is the default
lifetime applied to those cache items (by default it's ``0``).

Proxy Cache Adapter
~~~~~~~~~~~~~~~~~~~