32require_once __DIR__ .
'/../commandLine.inc';
33require_once
'languages.inc';
34require_once __DIR__ .
'/StatOutputs.php';
40# Default output is WikiText
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 );
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 );
$wgDummyLanguageCodes
Functionally the same as $wgExtraLanguageCodes, but deprecated.
static fetchLanguageName( $code, $inLanguage=null, $include='all')
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
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
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
while(( $__line=Maintenance::readconsole()) !==false) print
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
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title after the basic globals have been set but before ordinary actions take place $output
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
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
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
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
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
switch( $options['output']) $languages
if(isset( $options['help'])) if(!isset($options[ 'output'])) showUsage()
Print a usage message.
$wgRequiredMessagesNumber