core.diff
| b/classes/kohana/core.php | ||
|---|---|---|
| 748 | 748 |
{
|
| 749 | 749 |
if (is_file($dir.$file)) |
| 750 | 750 |
{
|
| 751 |
// get cached data |
|
| 752 |
$data = unserialize(file_get_contents($dir.$file)); |
|
| 753 |
// load lifetime |
|
| 754 |
$lifetime = arr::get($data, 'lifetime', $lifetime); |
|
| 755 | ||
| 751 | 756 |
if ((time() - filemtime($dir.$file)) < $lifetime) |
| 752 | 757 |
{
|
| 753 | 758 |
// Return the cache |
| 754 |
return unserialize(file_get_contents($dir.$file));
|
|
| 759 |
return arr::get($data, 'data');
|
|
| 755 | 760 |
} |
| 756 | 761 |
else |
| 757 | 762 |
{
|
| ... | ... | |
| 773 | 778 |
chmod($dir, 0777); |
| 774 | 779 |
} |
| 775 | 780 | |
| 781 |
// cache should contain lifetime |
|
| 782 |
$data = array |
|
| 783 |
( |
|
| 784 |
'data' => $data, |
|
| 785 |
'lifetime' => $lifetime, |
|
| 786 |
); |
|
| 787 |
|
|
| 776 | 788 |
// Write the cache |
| 777 | 789 |
return (bool) file_put_contents($dir.$file, serialize($data)); |
| 778 | 790 |
} |