| @@ 153-163 (lines=11) @@ | ||
| 150 | * If stored time is older then modified time, return false. |
|
| 151 | * @return false|mixed Return false on failure or older then modified time. Return the string associated with the $key on success. |
|
| 152 | */ |
|
| 153 | function get($key, $modified_time = 0) |
|
| 154 | { |
|
| 155 | if(!$this->handler) |
|
| 156 | { |
|
| 157 | return false; |
|
| 158 | } |
|
| 159 | ||
| 160 | $key = $this->getCacheKey($key); |
|
| 161 | ||
| 162 | return $this->handler->get($key, $modified_time); |
|
| 163 | } |
|
| 164 | ||
| 165 | /** |
|
| 166 | * Put data into cache |
|
| @@ 193-203 (lines=11) @@ | ||
| 190 | * @param string $key Cache key |
|
| 191 | * @return void |
|
| 192 | */ |
|
| 193 | function delete($key) |
|
| 194 | { |
|
| 195 | if(!$this->handler) |
|
| 196 | { |
|
| 197 | return false; |
|
| 198 | } |
|
| 199 | ||
| 200 | $key = $this->getCacheKey($key); |
|
| 201 | ||
| 202 | return $this->handler->delete($key); |
|
| 203 | } |
|
| 204 | ||
| 205 | /** |
|
| 206 | * Return whether cache is valid or invalid |
|
| @@ 213-223 (lines=11) @@ | ||
| 210 | * If stored time is older then modified time, the data is invalid. |
|
| 211 | * @return bool Return true on valid or false on invalid. |
|
| 212 | */ |
|
| 213 | function isValid($key, $modified_time = 0) |
|
| 214 | { |
|
| 215 | if(!$this->handler) |
|
| 216 | { |
|
| 217 | return false; |
|
| 218 | } |
|
| 219 | ||
| 220 | $key = $this->getCacheKey($key); |
|
| 221 | ||
| 222 | return $this->handler->isValid($key, $modified_time); |
|
| 223 | } |
|
| 224 | ||
| 225 | /** |
|
| 226 | * Truncate all cache |
|