From: Robert Leverington Date: Sun, 8 Feb 2009 23:39:17 +0000 (+0000) Subject: * (bug 17408) Add $wgShowDebug configuration variable, displays debug data at the... X-Git-Tag: 1.31.0-rc.0~42975 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/supprimer.php?a=commitdiff_plain;h=47036c445a2e121ee16a5a25cd8a0f5dde183a91;p=lhc%2Fweb%2Fwiklou.git * (bug 17408) Add $wgShowDebug configuration variable, displays debug data at the bottom of the main content area when enabled. --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 2102b2adf2..949fd819bd 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1038,6 +1038,13 @@ $wgDebugDumpSql = false; */ $wgDebugLogGroups = array(); +/** + * Display debug data at the bottom of the main content area. + * + * Useful for developers and technical users trying to working on a closed wiki. + */ +$wgShowDebug = false; + /** * Show the contents of $wgHooks in Special:Version */ diff --git a/includes/Skin.php b/includes/Skin.php index 66b2197d80..e326ed806a 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -889,13 +889,28 @@ END; return $data; } + /** + * Generate debug data HTML for displaying at the bottom of the main content + * area. + * @return String HTML containing debug data, if enabled (otherwise empty). + */ + protected function generateDebugHTML() { + global $wgShowDebug, $wgOut; + if ( $wgShowDebug ) { + $listInternals = str_replace( "\n", "\n
  • ", htmlspecialchars( $wgOut->mDebugtext ) ); + return "\n
    \nDebug data:\n"; + } + return ''; + } + /** * This gets called shortly before the tag. * @return String HTML to be put before */ function afterContent() { $printfooter = "
    \n" . $this->printFooter() . "
    \n"; - return $printfooter . $this->doAfterContent(); + return $this->generateDebugHTML() . $printfooter . $this->doAfterContent(); } /** diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 59596718e8..60b3eaa4a0 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -401,7 +401,7 @@ class SkinTemplate extends Skin { $tpl->set( 'bottomscripts', $this->bottomScripts() ); $printfooter = "
    \n" . $this->printSource() . "
    \n"; - $out->mBodytext .= $printfooter ; + $out->mBodytext .= $printfooter . $this->generateDebugHTML(); $tpl->setRef( 'bodytext', $out->mBodytext ); # Language links