From 2d816d5b3b724b1887b6cc290742977c40a9ad6c Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Fri, 15 Sep 2023 14:30:15 +0200
Subject: [PATCH] enable debug in config

---
 public_html/inc_config.php.dist | 3 +++
 public_html/packages/index.php  | 9 +++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/public_html/inc_config.php.dist b/public_html/inc_config.php.dist
index 58ac35d..0d163ef 100644
--- a/public_html/inc_config.php.dist
+++ b/public_html/inc_config.php.dist
@@ -27,4 +27,7 @@ return array(
     // allow directory listing when accessing a path of a package
     // true is required to fetch all packages
     'showdircontent'=>true,
+
+    // Enable for troubleshooting
+    'debug'=>false,    
 );
\ No newline at end of file
diff --git a/public_html/packages/index.php b/public_html/packages/index.php
index cc987e1..45e0003 100644
--- a/public_html/packages/index.php
+++ b/public_html/packages/index.php
@@ -10,7 +10,7 @@
  * ======================================================================
  */
 
-    $bDebug=false;
+
     ini_set('display_errors', 1);
     ini_set('display_startup_errors', 1);
     error_reporting(E_ALL);
@@ -18,6 +18,7 @@
     require_once('../inc_functions.php');
     $aConfig=require_once("../inc_config.php");
     
+    $bDebug=isset($aConfig['debug']) && $aConfig['debug'] ? true : false;
     $lockfile=$aConfig['tmpdir'].'/used_hashes.txt';
     $iMaxAge=$aConfig['maxage'];
 
@@ -26,9 +27,9 @@
     // MAIN
     // ----------------------------------------------------------------------
 
-    _wd('Start: '.date('Y-m-d H:i:s').'<style>body{background:#eee; color:#456;}
-            .debug{background:#ddd; margin-bottom: 2px;}
-         </style>');
+    // _wd('Start: '.date('Y-m-d H:i:s').'<style>body{background:#eee; color:#456;}
+    //         .debug{background:#ddd; margin-bottom: 2px;}
+    //      </style>');
 
     _wd('request uri is '.$_SERVER["REQUEST_URI"]); 
     _wd('<pre>GET: '.print_r($_GET, 1).'</pre>');
-- 
GitLab