1
0
Fork 0
forked from blallo/rss-bridge
This commit is contained in:
logmanoriginal 2016-10-02 17:21:16 +02:00
commit f0f0ffb96a
2 changed files with 7 additions and 6 deletions

View file

@ -41,7 +41,7 @@ if(file_exists('DEBUG')){
if($debug_enabled){ if($debug_enabled){
ini_set('display_errors', '1'); ini_set('display_errors', '1');
error_reporting(E_ALL); error_reporting(E_ALL);
define('DEBUG', 'true'); define('DEBUG', true);
} }
} }
@ -116,12 +116,11 @@ try {
die; die;
} }
$cache = Cache::create('FileCache');
// Data retrieval // Data retrieval
$bridge = Bridge::create($bridge); $bridge = Bridge::create($bridge);
if(!defined("DEBUG"))
$bridge->setCache($cache); $cache = Cache::create('FileCache');
$bridge->setCache($cache);
$noproxy = filter_input(INPUT_GET, '_noproxy', FILTER_VALIDATE_BOOLEAN); $noproxy = filter_input(INPUT_GET, '_noproxy', FILTER_VALIDATE_BOOLEAN);
if(defined('PROXY_URL') && PROXY_BYBRIDGE && $noproxy){ if(defined('PROXY_URL') && PROXY_BYBRIDGE && $noproxy){

View file

@ -140,7 +140,9 @@ abstract class BridgeAbstract implements BridgeInterface {
if(!is_null($this->cache)){ if(!is_null($this->cache)){
$this->cache->prepare($inputs); $this->cache->prepare($inputs);
$time = $this->cache->getTime(); $time = $this->cache->getTime();
if($time !== false && (time() - static::CACHE_TIMEOUT < $time)){ if($time !== false
&& (time() - static::CACHE_TIMEOUT < $time)
&& (!defined('DEBUG') || DEBUG !== true)){
$this->items = $this->cache->loadData(); $this->items = $this->cache->loadData();
return; return;
} }