|
@@ 44-47 (lines=4) @@
|
| 41 |
|
// The object which was previously stored, or false if a cache miss occurred. |
| 42 |
|
public function get($key) { |
| 43 |
|
//return false; |
| 44 |
|
if (($this->cleanInterval == 1) || |
| 45 |
|
(rand(1, $this->cleanInterval) == $this->cleanInterval)) { |
| 46 |
|
$this->clean(); |
| 47 |
|
} |
| 48 |
|
$val = false; |
| 49 |
|
$fn = $this->getCacheFilename($key); |
| 50 |
|
$exptime = time()-$this->expirationTimeInSeconds; |
|
@@ 63-66 (lines=4) @@
|
| 60 |
|
// $key: The cache key. |
| 61 |
|
// $value: The object to store. |
| 62 |
|
public function set($key, $value) { |
| 63 |
|
if (($this->cleanInterval == 1) || |
| 64 |
|
(rand(1, $this->cleanInterval) == $this->cleanInterval)) { |
| 65 |
|
$this->clean(); |
| 66 |
|
} |
| 67 |
|
$fn = $this->getCacheFilename($key, true); |
| 68 |
|
$fileData = file_put_contents($fn,serialize($value)); |
| 69 |
|
} |