MediaWiki master
alltrans.php
Go to the documentation of this file.
1<?php
24require_once __DIR__ . '/../Maintenance.php';
25
32class AllTrans extends Maintenance {
33
34 public function __construct() {
35 parent::__construct();
36 $this->addDescription( 'Get all messages as defined by the English language file' );
37 }
38
39 public function execute() {
40 $localisationCache = $this->getServiceContainer()->getLocalisationCache();
41 $englishMessages = $localisationCache->getItem( 'en', 'messages' );
42 foreach ( $englishMessages as $key => $_ ) {
43 $this->output( "$key\n" );
44 }
45 }
46}
47
48$maintClass = AllTrans::class;
49require_once RUN_MAINTENANCE_IF_MAIN;
$maintClass
Definition alltrans.php:48
Maintenance script that gets all messages as defined by the English language file.
Definition alltrans.php:32
__construct()
Default constructor.
Definition alltrans.php:34
execute()
Do the actual work.
Definition alltrans.php:39
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
output( $out, $channel=null)
Throw some output to the user.
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.