1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-03 15:17:33 +02:00

[BridgeAbstract] Replace getCacheDuration() with CACHE_TIMEOUT

LogMANOriginal
2016-10-02 15:50:31 +02:00
parent 4ee67c7b0a
commit 19d26a9982

@@ -5,7 +5,6 @@ To create a new Bridge extending `BridgeAbstract` you must specify some [basic m
- [`collectData`](#the-collectdata-function) (**required**)
- [`getName`](#the-getname-function)
- [`getURI`](#the-geturi-function)
- [`getCacheDuration`](#the-getcacheduration-function)
Find a [template](#template) at the end of this file.
@@ -19,6 +18,7 @@ const URI // URI to the target website of the bridge ("http://....")
const DESCRIPTION // A brief description of the Bridge
const MAINTAINER // Name of the maintainer
const PARAMETERS // (optional) Definition of additional parameters
const CACHE_TIMEOUT // (optional) Defines the maximum duration for the cache in seconds (default: 3600)
```
Find a description of `const PARAMETERS` [below](#parameters)
@@ -191,18 +191,6 @@ This function returns the URI to the destination site of the bridge. It will be
}
```
## The `getCacheDuration` function
This function returns the time in **seconds** during which rss-bridge will output cached values instead of re-generating a RSS feed.
**Notice:** **RSS-Bridge** will return `3600` seconds (1 hour) by default, so you only have to implement this function if you require different timing!
```PHP
public function getCacheDuration(){
return 3600; // 1 hour
}
```
# Bridge Abstract functions
All bridges extend from `BridgeAbstract` and therefore are able to make use of functions defined in `BridgeAbstract`.
@@ -277,6 +265,7 @@ class MySiteBridge extends BridgeAbstract {
const DESCRIPTION = 'No description provided';
const MAINTAINER = 'No maintainer';
const PARAMETERS = array();
const CACHE_TIMEOUT = 3600;
public function collectData(){
// Implement your bridge here!