File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
components/cache/adapters Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,7 @@ Array Cache Adapter
8
8
Generally, this adapter is useful for testing purposes, as its contents are stored in memory
9
9
and not persisted outside the running PHP process in any way. It can also be useful while
10
10
warming up caches, due to the :method: `Symfony\\ Component\\ Cache\\ Adapter\\ ArrayAdapter::getValues `
11
- method.
12
-
13
- This adapter can be passed a default cache lifetime as its first parameter, and a boolean that
14
- toggles serialization as its second parameter::
11
+ method::
15
12
16
13
use Symfony\Component\Cache\Adapter\ArrayAdapter;
17
14
@@ -23,5 +20,17 @@ toggles serialization as its second parameter::
23
20
$defaultLifetime = 0,
24
21
25
22
// if ``true``, the values saved in the cache are serialized before storing them
26
- $storeSerialized = true
23
+ $storeSerialized = true,
24
+
25
+ // the maximum lifetime (in seconds) of the entire cache (after this time, the
26
+ // entire cache is deleted to avoid stale data from consuming memory)
27
+ $maxLifetime = 0,
28
+
29
+ // the maximum number of items that can be stored in the cache. When the limit
30
+ // is reached, cache follows the LRU model (least recently used items are deleted)
31
+ $maxItems = 0
27
32
);
33
+
34
+ .. versionadded :: 5.1
35
+
36
+ The ``maxLifetime `` and ``maxItems `` options were introduced in Symfony 5.1.
You can’t perform that action at this time.
0 commit comments