diff --git a/index.php b/index.php index c8ef051..9cb9251 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); } } @@ -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){ diff --git a/lib/BridgeAbstract.php b/lib/BridgeAbstract.php index 82a1014..2a64832 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; }