MediaWiki REL1_32
dumpMessages.php
Go to the documentation of this file.
1<?php
26require_once __DIR__ . '/../Maintenance.php';
27
34 public function __construct() {
35 parent::__construct();
36 $this->addDescription( 'Dump an entire language, using the keys from English' );
37 }
38
39 public function execute() {
40 global $wgVersion;
41
42 $messages = [];
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::class;
52require_once RUN_MAINTENANCE_IF_MAIN;
serialize()
$wgVersion
MediaWiki version number.
$messages
Maintenance script that dumps an entire language, using the keys from English.
__construct()
Default constructor.
execute()
Do the actual work.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
output( $out, $channel=null)
Throw some output to the user.
addDescription( $text)
Set the description text.
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 use $formDescriptor instead 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;div ...>$1&lt;/div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
$maintClass
require_once RUN_MAINTENANCE_IF_MAIN