From 1ae2b2e77943251dc4fa42f5095acc4d3d834744 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 20 Dec 2007 22:39:21 +0000 Subject: [PATCH] Better display of development versions, and make the DEBUG session output easily switch on-off-able by passing in ?debug=true or ?debug=false to any page. --- common.inc.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/common.inc.php b/common.inc.php index 323a4c3..8627d13 100644 --- a/common.inc.php +++ b/common.inc.php @@ -217,6 +217,9 @@ if(!$_SESSION['lang']) $_SESSION['lang']="en"; } +//only allow debug to get set if we're using a development version (odd numbered ending) +if(substr($config['version'], -1) % 2 != 0) + if($_GET['debug']) $_SESSION['debug']=$_GET['debug']; //if the user has switched languages, go ahead and switch the session variable if($_GET['switchlanguage']) @@ -617,10 +620,12 @@ global $config; //we only show the debug session variables if we have an ODD numbered version. if(substr($config['version'], -1) % 2 != 0) { - echo "DEBUG:"; - print_r($_SESSION); + $revision=exec("svn info |grep Revision"); + $extra=" (Development $revision)"; + if($_SESSION['debug']=="true") + $extra.=" DEBUG: ".print_r($_SESSION,true); } -echo "SFIAB Version ".$config['version'].""; +echo "SFIAB Version ".$config['version']."{$extra}"; ?>