forked from cleverage/process-bundle-ui-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMemoryAdapter.php
More file actions
42 lines (34 loc) · 1.35 KB
/
Copy pathMemoryAdapter.php
File metadata and controls
42 lines (34 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
declare(strict_types=1);
/*
* This file is part of the CleverAge/ProcessBundleDemo package.
*
* Copyright (c) Clever-Age
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Adapter;
use CleverAge\CacheProcessBundle\Adapter\Adapter;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
class MemoryAdapter extends Adapter
{
public function __construct()
{
$cache = new ArrayAdapter(
// the default lifetime (in seconds) for cache items that do not define their
// own lifetime, with a value 0 causing items to be stored indefinitely (i.e.
// until the current PHP process finishes)
$defaultLifetime = 0,
// if true, the values saved in the cache are serialized before storing them
$storeSerialized = true,
// the maximum lifetime (in seconds) of the entire cache (after this time, the
// entire cache is deleted to avoid stale data from consuming memory)
$maxLifetime = 0,
// the maximum number of items that can be stored in the cache. When the limit
// is reached, cache follows the LRU model (least recently used items are deleted)
$maxItems = 0
);
parent::__construct($cache, 'memory');
}
}