MediaWiki  1.23.2
dumpMessages.php
Go to the documentation of this file.
1 <?php
26 require_once __DIR__ . '/../Maintenance.php';
27 
33 class DumpMessages extends Maintenance {
34  public function __construct() {
35  parent::__construct();
36  $this->mDescription = "Dump an entire language, using the keys from English";
37  }
38 
39  public function execute() {
40  global $wgVersion;
41 
42  $messages = array();
43  foreach ( array_keys( Language::getMessagesFor( 'en' ) ) as $key ) {
44  $messages[$key] = wfMessage( $key )->text();
45  }
46  $this->output( "MediaWiki $wgVersion language file\n" );
47  $this->output( serialize( $messages ) );
48  }
49 }
50 
51 $maintClass = "DumpMessages";
52 require_once RUN_MAINTENANCE_IF_MAIN;
DumpMessages
Maintenance script that dumps an entire language, using the keys from English.
Definition: dumpMessages.php:33
DumpMessages\execute
execute()
Do the actual work.
Definition: dumpMessages.php:39
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
DumpMessages\__construct
__construct()
Default constructor.
Definition: dumpMessages.php:34
RUN_MAINTENANCE_IF_MAIN
require_once RUN_MAINTENANCE_IF_MAIN
Definition: maintenance.txt:50
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition: maintenance.txt:39
$messages
$messages
Definition: LogTests.i18n.php:8
$maintClass
$maintClass
Definition: dumpMessages.php:51
wfMessage
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 noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables 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 set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
Language\getMessagesFor
static getMessagesFor( $code)
Get all messages for a given language WARNING: this may take a long time.
Definition: Language.php:4192
as
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
Definition: distributors.txt:9
Maintenance\output
output( $out, $channel=null)
Throw some output to the user.
Definition: Maintenance.php:314