32 require_once __DIR__ .
'/../commandLine.inc';
33 require_once
'languages.inc';
34 require_once __DIR__ .
'/StatOutputs.php';
40 # Default output is WikiText
41 if ( !isset(
$options[
'output'] ) ) {
51 *
'csv' : Comma Separated Values.
53 *
'text' : Text with tabs.
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 );
120 $emptyMessages =
$languages->getEmptyMessages( $code );
121 $messagesWithWhitespace =
$languages->getMessagesWithWhitespace( $code );
122 $nonXHTMLMessages =
$languages->getNonXHTMLMessages( $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 );
globals txt Globals are evil The original MediaWiki code relied on globals for processing context far too often MediaWiki development since then has been a story of slowly moving context out of global variables and into objects Storing processing context in object member variables allows those objects to be reused in a much more flexible way Consider the elegance of
database rows
$wgRequiredMessagesNumber
We use the convention $dbr for read and $dbw for write to help you keep track of whether the database object is a the world will explode Or to be a subsequent write query which succeeded on the master may fail when replicated to the slave due to a unique key collision Replication on the slave will stop and it may take hours to repair the database and get it back online Setting read_only in my cnf on the slave will avoid this but given the dire we prefer to have as many checks as possible We provide a but the wrapper functions like select() and insert() are usually more convenient.They take care of things like table prefixes and escaping for you.If you really need to make your own SQL
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
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a message
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
switch($options['output']) $languages
$wgDummyLanguageCodes
List of language codes that don't correspond to an actual language.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
static fetchLanguageName($code, $inLanguage=null, $include= 'all')
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object & $output
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
if(isset($options['help'])) if(!isset($options['output'])) showUsage()
Print a usage message.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling output() to send it all.It could be easily changed to send incrementally if that becomes useful