1 | <?php |
||
12 | class SecondLevelCacheConfiguration extends AbstractOptions |
||
13 | { |
||
14 | /** |
||
15 | * Enable the second level cache configuration |
||
16 | * |
||
17 | * @var bool |
||
18 | */ |
||
19 | protected $enabled = false; |
||
20 | |||
21 | /** |
||
22 | * Default lifetime |
||
23 | * |
||
24 | * @var int |
||
25 | */ |
||
26 | protected $defaultLifetime = 3600; |
||
27 | |||
28 | /** |
||
29 | * Default lock lifetime |
||
30 | * |
||
31 | * @var int |
||
32 | */ |
||
33 | protected $defaultLockLifetime = 60; |
||
34 | |||
35 | /** |
||
36 | * The file lock region directory (needed for some cache usage) |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $fileLockRegionDirectory = ''; |
||
41 | |||
42 | /** |
||
43 | * Configure the lifetime and lock lifetime per region. You must pass an associative array like this: |
||
44 | * |
||
45 | * [ |
||
46 | * 'My\Region' => ['lifetime' => 200, 'lock_lifetime' => 400], |
||
47 | * ] |
||
48 | * |
||
49 | * @var mixed[] |
||
50 | */ |
||
51 | protected $regions = []; |
||
52 | |||
53 | 1 | public function setEnabled(bool $enabled) : void |
|
57 | |||
58 | 86 | public function isEnabled() : bool |
|
62 | |||
63 | 1 | public function setDefaultLifetime(int $defaultLifetime) : void |
|
67 | |||
68 | 1 | public function getDefaultLifetime() : int |
|
72 | |||
73 | 1 | public function setDefaultLockLifetime(int $defaultLockLifetime) : void |
|
77 | |||
78 | 1 | public function getDefaultLockLifetime() : int |
|
82 | |||
83 | 1 | public function setFileLockRegionDirectory(string $fileLockRegionDirectory) : void |
|
87 | |||
88 | 1 | public function getFileLockRegionDirectory() : string |
|
92 | |||
93 | /** |
||
94 | * @param mixed[] $regions |
||
95 | */ |
||
96 | 1 | public function setRegions(array $regions) : void |
|
100 | |||
101 | /** |
||
102 | * @return mixed[] |
||
103 | */ |
||
104 | 1 | public function getRegions() : array |
|
108 | } |
||
109 |