MediaWiki master
alltrans.php
Go to the documentation of this file.
1<?php
25
26// @codeCoverageIgnoreStart
27require_once __DIR__ . '/../Maintenance.php';
28// @codeCoverageIgnoreEnd
29
36class AllTrans extends Maintenance {
37
38 public function __construct() {
39 parent::__construct();
40 $this->addDescription( 'Get all messages as defined by the English language file' );
41 }
42
43 public function execute() {
44 $localisationCache = $this->getServiceContainer()->getLocalisationCache();
45 $englishMessages = $localisationCache->getItem( 'en', 'messages' );
46 foreach ( $englishMessages as $key => $_ ) {
47 $this->output( "$key\n" );
48 }
49 }
50}
51
52// @codeCoverageIgnoreStart
53$maintClass = AllTrans::class;
54require_once RUN_MAINTENANCE_IF_MAIN;
55// @codeCoverageIgnoreEnd
$maintClass
Definition alltrans.php:53
Maintenance script that gets all messages as defined by the English language file.
Definition alltrans.php:36
__construct()
Default constructor.
Definition alltrans.php:38
execute()
Do the actual work.
Definition alltrans.php:43
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.