From 3e8a7624e151eedda0007d8336b9da2177544c4f Mon Sep 17 00:00:00 2001 From: "teromene@teromene.fr" Date: Thu, 3 Mar 2016 15:26:07 +0000 Subject: [PATCH 1/2] Added an URL option to activate debug : debug activates all messages, and disables the cache. --- index.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 783e91a..5e9dfbb 100644 --- a/index.php +++ b/index.php @@ -14,7 +14,14 @@ TODO : date_default_timezone_set('UTC'); error_reporting(0); -//ini_set('display_errors','1'); error_reporting(E_ALL); // For debugging only. + +if(isset($_REQUEST['debug'])) { + + ini_set('display_errors','1'); error_reporting(E_ALL); //Report all errors + + $_REQUEST["disable_cache"] = true; //Disable the cache. + +} require_once __DIR__ . '/lib/RssBridge.php'; From d7f079e66b7ca3b58c41f522440f471ae382f860 Mon Sep 17 00:00:00 2001 From: Teromene Date: Thu, 17 Mar 2016 14:36:33 +0000 Subject: [PATCH 2/2] Modified the debug system to use a file as a trigger instead of a URL parameter. Modified the gitignore accordingly. --- .gitignore | 1 + index.php | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 4c658bf..9a267f6 100644 --- a/.gitignore +++ b/.gitignore @@ -226,3 +226,4 @@ pip-log.txt ############## /cache /whitelist.txt +DEBUG diff --git a/index.php b/index.php index 5e9dfbb..a8f96fc 100644 --- a/index.php +++ b/index.php @@ -15,11 +15,10 @@ TODO : date_default_timezone_set('UTC'); error_reporting(0); -if(isset($_REQUEST['debug'])) { +if(file_exists("DEBUG")) { ini_set('display_errors','1'); error_reporting(E_ALL); //Report all errors - - $_REQUEST["disable_cache"] = true; //Disable the cache. + define("DEBUG", "true"); } @@ -91,7 +90,7 @@ try{ // Data retrieval $bridge = Bridge::create($bridge); - if(isset($_REQUEST["disable_cache"])) { + if(defined("DEBUG")) { } else { $bridge->setCache($cache); // just add disable cache to your query to disable caching }