mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-31 22:00:23 +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:
@@ -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;
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
interface BridgeInterface {
|
||||
public function collectData();
|
||||
public function getCacheDuration();
|
||||
public function getName();
|
||||
public function getURI();
|
||||
}
|
||||
|
Reference in New Issue
Block a user