From 978e5cdbf5b3554bc7bf2b950c2af01df06d3304 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sun, 2 Oct 2016 16:43:08 +0200 Subject: [PATCH 1/3] [index] Define cache even in DEBUG mode --- index.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index c8ef0517..45a0657b 100644 --- a/index.php +++ b/index.php @@ -116,12 +116,11 @@ try { die; } - $cache = Cache::create('FileCache'); - // Data retrieval $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); if(defined('PROXY_URL') && PROXY_BYBRIDGE && $noproxy){ From b0784e5a427417f17fe525a489657a532a6433d1 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sun, 2 Oct 2016 17:00:53 +0200 Subject: [PATCH 2/3] [BridgeAbstract] Don't load cache file in DEBUG mode --- lib/BridgeAbstract.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/BridgeAbstract.php b/lib/BridgeAbstract.php index 82a10143..2a648329 100644 --- a/lib/BridgeAbstract.php +++ b/lib/BridgeAbstract.php @@ -140,7 +140,9 @@ abstract class BridgeAbstract implements BridgeInterface { if(!is_null($this->cache)){ $this->cache->prepare($inputs); $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(); return; } From b32cfd5dc3df072657d76f77a23413461aecfa2c Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sun, 2 Oct 2016 17:16:21 +0200 Subject: [PATCH 3/3] [index] Explicitly define DEBUG with Boolean value --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 45a0657b..9cb9251f 100644 --- a/index.php +++ b/index.php @@ -41,7 +41,7 @@ if(file_exists('DEBUG')){ if($debug_enabled){ ini_set('display_errors', '1'); error_reporting(E_ALL); - define('DEBUG', 'true'); + define('DEBUG', true); } }