MediaWiki REL1_31
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...
addDescription( $text)
Set the description text.
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
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 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