From 327ec6ece10afffe51789cf119d2ae4f9e3c5f90 Mon Sep 17 00:00:00 2001 From: Jimmy Collins Date: Sun, 1 Oct 2006 18:44:47 +0000 Subject: [PATCH] * Add version to wiki output * Add output option 'metawiki' with additional category; only used for Meta-Wiki --- maintenance/transstat.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/maintenance/transstat.php b/maintenance/transstat.php index 5f51083ba0..7bee51660a 100644 --- a/maintenance/transstat.php +++ b/maintenance/transstat.php @@ -29,9 +29,10 @@ function showUsage() { Usage: php transstat.php [--help] [--output=csv|text|wiki] --help : this helpful message --output : select an output engine one of: - * 'csv' : Comma Separated Values. - * 'wiki' : MediaWiki syntax (default). - * 'text' : Text with tabs. + * 'csv' : Comma Separated Values. + * 'wiki' : MediaWiki syntax (default). + * 'metawiki' : MediaWiki syntax used for Meta-Wiki. + * 'text' : Text with tabs. Example: php maintenance/transstat.php --output=text END; @@ -60,6 +61,9 @@ class statsOutput { /** Outputs WikiText */ class wikiStatsOutput extends statsOutput { function heading() { + global $IP; + $version = SpecialVersion::getVersion( $IP ); + echo "'''Statistics based on:''' " . $version . "\n\n"; echo "'''Note:''' These statistics can be generated by running php maintenance/transstat.php.\n\n"; echo "For additional information on specific languages (the message names, the actual problems, etc.), run php maintenance/checkLanguage.php --lang=foo.\n\n"; echo "{| border=2 cellpadding=4 cellspacing=0 style=\"background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse;\" width=100%\n"; @@ -98,6 +102,14 @@ class wikiStatsOutput extends statsOutput { } } +/** Outputs WikiText and appends category only used for Meta-Wiki */ +class metawikiStatsOutput extends wikiStatsOutput { + function footer() { + echo "|}\n\n"; + echo "[[Category:Localisation|Statistics]]\n"; + } +} + /** Output text. To be used on a terminal for example. */ class textStatsOutput extends statsOutput { function element( $in, $heading = false ) { @@ -123,6 +135,9 @@ switch ( $options['output'] ) { case 'wiki': $wgOut = new wikiStatsOutput(); break; + case 'metawiki': + $wgOut = new metawikiStatsOutput(); + break; case 'text': $wgOut = new textStatsOutput(); break; -- 2.20.1