2016-09-05 18:05:19 +02:00
|
|
|
<?php
|
2018-11-16 21:48:59 +01:00
|
|
|
/**
|
|
|
|
* This file is part of RSS-Bridge, a PHP project capable of generating RSS and
|
|
|
|
* Atom feeds for websites that don't have one.
|
|
|
|
*
|
|
|
|
* For the full license information, please view the UNLICENSE file distributed
|
|
|
|
* with this source code.
|
|
|
|
*
|
|
|
|
* @package Core
|
|
|
|
* @license http://unlicense.org/ UNLICENSE
|
|
|
|
* @link https://github.com/rss-bridge/rss-bridge
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The cache interface
|
|
|
|
*
|
|
|
|
* @todo Add missing function to the interface
|
|
|
|
* @todo Explain parameters and return values in more detail
|
|
|
|
* @todo Return self more often (to allow call chaining)
|
|
|
|
*/
|
2016-09-10 20:41:11 +02:00
|
|
|
interface CacheInterface {
|
2018-11-16 21:48:59 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads data from cache
|
|
|
|
*
|
|
|
|
* @return mixed The cache data
|
|
|
|
*/
|
2016-09-10 20:41:11 +02:00
|
|
|
public function loadData();
|
2018-11-16 21:48:59 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Stores data to the cache
|
|
|
|
*
|
|
|
|
* @param mixed $datas The data to store
|
|
|
|
* @return self The cache object
|
|
|
|
*/
|
2016-09-10 20:41:11 +02:00
|
|
|
public function saveData($datas);
|
2018-11-16 21:48:59 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the timestamp for the curent cache file
|
|
|
|
*
|
|
|
|
* @return int Timestamp
|
|
|
|
*/
|
2016-09-10 20:41:11 +02:00
|
|
|
public function getTime();
|
2018-11-16 21:48:59 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes any data that is older than the specified duration from cache
|
|
|
|
*
|
|
|
|
* @param int $duration The cache duration in seconds
|
|
|
|
*/
|
2016-10-08 16:18:10 +02:00
|
|
|
public function purgeCache($duration);
|
2016-09-05 18:05:19 +02:00
|
|
|
}
|