1
0
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:
Pierre Mazière
2016-09-25 17:04:28 +02:00
parent ad534444fa
commit 235c985901
81 changed files with 84 additions and 332 deletions

View File

@@ -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;
}

View File

@@ -1,7 +1,6 @@
<?php
interface BridgeInterface {
public function collectData();
public function getCacheDuration();
public function getName();
public function getURI();
}