48Usage:
php transstat.php [--help] [--output=csv|
text|
wiki]
50 --output :
select an output engine one
of:
51 *
'csv' : Comma Separated Values.
53 *
'text' : Text with tabs.
54Example:
php maintenance/transstat.php --output=
text
60# Select an output engine
81$output->element(
'Language',
true );
82$output->element(
'Code',
true );
83$output->element(
'Fallback',
true );
84$output->element(
'Translated',
true );
86$output->element(
'Obsolete',
true );
88$output->element(
'Problematic',
true );
96 # Don't check English, RTL English or dummy language codes
103 # Calculate the numbers
107 $messagesNumber = count(
$messages[
'translated'] );
108 $requiredMessagesNumber = count(
$messages[
'required'] );
109 $requiredMessagesPercent =
$output->formatPercent(
110 $requiredMessagesNumber,
113 $obsoleteMessagesNumber = count(
$messages[
'obsolete'] );
114 $obsoleteMessagesPercent =
$output->formatPercent(
115 $obsoleteMessagesNumber,
119 $messagesWithMismatchVariables =
$languages->getMessagesWithMismatchVariables(
$code );
121 $messagesWithWhitespace =
$languages->getMessagesWithWhitespace(
$code );
123 $messagesWithWrongChars =
$languages->getMessagesWithWrongChars(
$code );
124 $problematicMessagesNumber = count( array_unique( array_merge(
125 $messagesWithMismatchVariables,
127 $messagesWithWhitespace,
129 $messagesWithWrongChars
131 $problematicMessagesPercent =
$output->formatPercent(
132 $problematicMessagesNumber,
139 $output->element(
"$language" );
141 $output->element(
"$fallback" );
142 $output->element(
"$requiredMessagesNumber/$wgRequiredMessagesNumber" );
143 $output->element( $requiredMessagesPercent );
144 $output->element(
"$obsoleteMessagesNumber/$messagesNumber" );
145 $output->element( $obsoleteMessagesPercent );
146 $output->element(
"$problematicMessagesNumber/$messagesNumber" );
147 $output->element( $problematicMessagesPercent );
Prior to maintenance scripts were a hodgepodge of code that had no cohesion or formal method of action Beginning maintenance scripts have been cleaned up to use a unified class Directory structure How to run a script How to write your own DIRECTORY STRUCTURE The maintenance directory of a MediaWiki installation contains several all of which have unique purposes HOW TO RUN A SCRIPT Ridiculously just call php someScript php that s in the top level maintenance directory if not default wiki