mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 01:55:21 +02:00
[BridgeAbstract] replace getCacheDuration method by CACHE_TIMEOUT class constant
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
ad534444fa
commit
235c985901
81 changed files with 84 additions and 332 deletions
|
@ -6,6 +6,7 @@ abstract class BridgeAbstract implements BridgeInterface {
|
|||
const URI = '';
|
||||
const DESCRIPTION = 'No description provided';
|
||||
const MAINTAINER = 'No maintainer';
|
||||
const CACHE_TIMEOUT = 3600;
|
||||
const PARAMETERS = array();
|
||||
|
||||
public $useProxy = true;
|
||||
|
@ -252,7 +253,7 @@ abstract class BridgeAbstract implements BridgeInterface {
|
|||
if(!is_null($this->cache)){
|
||||
$this->cache->prepare($inputs);
|
||||
$time = $this->cache->getTime();
|
||||
if($time !== false && (time() - $this->getCacheDuration() < $time)){
|
||||
if($time !== false && (time() - static::CACHE_TIMEOUT < $time)){
|
||||
$this->items = $this->cache->loadData();
|
||||
return;
|
||||
}
|
||||
|
@ -306,10 +307,6 @@ abstract class BridgeAbstract implements BridgeInterface {
|
|||
return static::URI;
|
||||
}
|
||||
|
||||
public function getCacheDuration(){
|
||||
return 3600;
|
||||
}
|
||||
|
||||
public function setCache(\CacheAbstract $cache){
|
||||
$this->cache = $cache;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue