1 | <?php |
||
18 | class CacheAnalyzerBackend extends AbstractAnalyzerBackend implements FreezableBackendInterface, PhpCapableBackendInterface, TaggableBackendInterface |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Setter for compression flags bit |
||
23 | * |
||
24 | * @param boolean $useCompression |
||
25 | * |
||
26 | * @return void |
||
27 | */ |
||
28 | protected function setCompression($useCompression) |
||
31 | |||
32 | /** |
||
33 | * Saves data in the cache. |
||
34 | * |
||
35 | * @param string $entryIdentifier An identifier for this specific cache entry |
||
36 | * @param string $data The data to be stored |
||
37 | * @param array $tags Tags to associate with this cache entry. If the backend does not support tags, this option can be ignored. |
||
38 | * @param integer $lifetime Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime. |
||
39 | * |
||
40 | * @return void |
||
41 | * @throws \TYPO3\CMS\Core\Cache\Exception if no cache frontend has been set. |
||
42 | * @throws \TYPO3\CMS\Core\Cache\Exception\InvalidDataException if the data is not a string |
||
43 | */ |
||
44 | public function set($entryIdentifier, $data, array $tags = [], $lifetime = null) |
||
49 | |||
50 | /** |
||
51 | * Loads data from the cache. |
||
52 | * |
||
53 | * @param string $entryIdentifier An identifier which describes the cache entry to load |
||
54 | * |
||
55 | * @return mixed The cache entry's content as a string or FALSE if the cache entry could not be loaded |
||
56 | */ |
||
57 | public function get($entryIdentifier) |
||
58 | { |
||
59 | $this->logEntry('get', $entryIdentifier); |
||
60 | $data = $this->originalBackend->get($entryIdentifier); |
||
61 | $this->logEntry('getAfter', $entryIdentifier); |
||
62 | if ($data !== false) { |
||
63 | $this->logEntry('getTRUE', $entryIdentifier); |
||
64 | } |
||
65 | return $data; |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * Checks if a cache entry with the specified identifier exists. |
||
70 | * |
||
71 | * @param string $entryIdentifier An identifier specifying the cache entry |
||
72 | * |
||
73 | * @return boolean TRUE if such an entry exists, FALSE if not |
||
74 | */ |
||
75 | public function has($entryIdentifier) |
||
76 | { |
||
77 | $this->logEntry('has', $entryIdentifier); |
||
78 | $data = $this->originalBackend->has($entryIdentifier); |
||
79 | if ($data !== false) { |
||
80 | $this->logEntry('hasTRUE', $entryIdentifier); |
||
81 | } |
||
82 | return $data; |
||
83 | } |
||
84 | |||
85 | /** |
||
86 | * Removes all cache entries matching the specified identifier. |
||
87 | * Usually this only affects one entry but if - for what reason ever - |
||
88 | * old entries for the identifier still exist, they are removed as well. |
||
89 | * |
||
90 | * @param string $entryIdentifier Specifies the cache entry to remove |
||
91 | * |
||
92 | * @return boolean TRUE if (at least) an entry could be removed or FALSE if no entry was found |
||
93 | */ |
||
94 | public function remove($entryIdentifier) |
||
99 | |||
100 | /** |
||
101 | * Removes all cache entries of this cache. |
||
102 | * |
||
103 | * @return void |
||
104 | */ |
||
105 | public function flush() |
||
110 | |||
111 | /** |
||
112 | * Does garbage collection |
||
113 | * |
||
114 | * @return void |
||
115 | */ |
||
116 | public function collectGarbage() |
||
121 | |||
122 | /** |
||
123 | * Freezes this cache backend. |
||
124 | * |
||
125 | * All data in a frozen backend remains unchanged and methods which try to add |
||
126 | * or modify data result in an exception thrown. Possible expiry times of |
||
127 | * individual cache entries are ignored. |
||
128 | * |
||
129 | * On the positive side, a frozen cache backend is much faster on read access. |
||
130 | * A frozen backend can only be thawn by calling the flush() method. |
||
131 | * |
||
132 | * @return void |
||
133 | */ |
||
134 | public function freeze() |
||
141 | |||
142 | /** |
||
143 | * Tells if this backend is frozen. |
||
144 | * |
||
145 | * @return boolean |
||
146 | */ |
||
147 | public function isFrozen() |
||
155 | |||
156 | /** |
||
157 | * Loads PHP code from the cache and require_onces it right away. |
||
158 | * |
||
159 | * @param string $entryIdentifier An identifier which describes the cache entry to load |
||
160 | * |
||
161 | * @return mixed Potential return value from the include operation |
||
162 | */ |
||
163 | public function requireOnce($entryIdentifier) |
||
175 | |||
176 | /** |
||
177 | * Removes all cache entries of this cache which are tagged by the specified tag. |
||
178 | * |
||
179 | * @param string $tag The tag the entries must have |
||
180 | * |
||
181 | * @return void |
||
182 | */ |
||
183 | public function flushByTag($tag) |
||
190 | |||
191 | /** |
||
192 | * Finds and returns all cache entry identifiers which are tagged by the |
||
193 | * specified tag |
||
194 | * |
||
195 | * @param string $tag The tag to search for |
||
196 | * |
||
197 | * @return array An array with identifiers of all matching entries. An empty array if no entries matched |
||
198 | */ |
||
199 | public function findIdentifiersByTag($tag) |
||
207 | } |
||
208 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.