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.

This commit is contained in:
james 2007-12-20 22:39:21 +00:00
parent e4fb689d58
commit 1ae2b2e779

View File

@ -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 "<a target=\"blank\" href=\"http://www.sfiab.ca\">SFIAB Version ".$config['version']."</a>";
echo "<a target=\"blank\" href=\"http://www.sfiab.ca\">SFIAB Version ".$config['version']."{$extra}</a>";
?>
</div>