1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author Bram Gerritsen [email protected] |
4
|
|
|
* @author Aeneas Rekkas |
5
|
|
|
* @copyright (c) Bram Gerritsen 2013 |
6
|
|
|
* @license http://opensource.org/licenses/mit-license.php |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace StrokerCache\Options; |
10
|
|
|
|
11
|
|
|
use Zend\Stdlib\AbstractOptions; |
12
|
|
|
|
13
|
|
|
class ModuleOptions extends AbstractOptions |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* @var array |
17
|
|
|
*/ |
18
|
|
|
protected $idGenerators; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @var array |
22
|
|
|
*/ |
23
|
|
|
protected $strategies; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @var array |
27
|
|
|
*/ |
28
|
|
|
protected $storageAdapter; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var bool |
32
|
|
|
*/ |
33
|
|
|
protected $cacheResponse = true; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var string |
37
|
|
|
*/ |
38
|
|
|
protected $idGenerator = 'requesturi'; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var bool |
42
|
|
|
*/ |
43
|
|
|
protected $addDebugHeaders = true; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @var bool |
47
|
|
|
*/ |
48
|
|
|
protected $enabled = true; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @return boolean |
52
|
|
|
*/ |
53
|
|
|
public function getCacheResponse() |
54
|
|
|
{ |
55
|
|
|
return $this->cacheResponse; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @param boolean $cacheResponse |
60
|
|
|
*/ |
61
|
|
|
public function setCacheResponse($cacheResponse) |
62
|
|
|
{ |
63
|
|
|
$this->cacheResponse = $cacheResponse; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return string |
68
|
|
|
*/ |
69
|
|
|
public function getIdGenerator() |
70
|
|
|
{ |
71
|
|
|
return $this->idGenerator; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @param string $idGenerator |
76
|
|
|
*/ |
77
|
|
|
public function setIdGenerator($idGenerator) |
78
|
|
|
{ |
79
|
|
|
$this->idGenerator = $idGenerator; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @return array |
84
|
|
|
*/ |
85
|
|
|
public function getIdGenerators() |
86
|
|
|
{ |
87
|
|
|
return $this->idGenerators; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @param array $idGenerators |
92
|
|
|
*/ |
93
|
|
|
public function setIdGenerators($idGenerators) |
94
|
|
|
{ |
95
|
|
|
$this->idGenerators = $idGenerators; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @return array |
100
|
|
|
*/ |
101
|
|
|
public function getStorageAdapter() |
102
|
|
|
{ |
103
|
|
|
return $this->storageAdapter; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @param array $storageAdapter |
108
|
|
|
*/ |
109
|
|
|
public function setStorageAdapter(array $storageAdapter) |
110
|
|
|
{ |
111
|
|
|
$this->storageAdapter = $storageAdapter; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @return array |
116
|
|
|
*/ |
117
|
|
|
public function getStrategies() |
118
|
|
|
{ |
119
|
|
|
return $this->strategies; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @param array $strategies |
124
|
|
|
*/ |
125
|
|
|
public function setStrategies(array $strategies) |
126
|
|
|
{ |
127
|
|
|
$this->strategies = $strategies; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* @return bool |
132
|
|
|
*/ |
133
|
|
|
public function isAddDebugHeaders() |
134
|
|
|
{ |
135
|
|
|
return $this->addDebugHeaders; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* @param bool $addDebugHeaders |
140
|
|
|
*/ |
141
|
|
|
public function setAddDebugHeaders($addDebugHeaders) |
142
|
|
|
{ |
143
|
|
|
$this->addDebugHeaders = $addDebugHeaders; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* @return boolean |
148
|
|
|
*/ |
149
|
|
|
public function isEnabled() |
150
|
|
|
{ |
151
|
|
|
return $this->enabled; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* @param boolean $enabled |
156
|
|
|
*/ |
157
|
|
|
public function setEnabled($enabled) |
158
|
|
|
{ |
159
|
|
|
$this->enabled = $enabled; |
160
|
|
|
} |
161
|
|
|
} |
162
|
|
|
|