MediaWiki master
alltrans.php
Go to the documentation of this file.
1<?php
11
12// @codeCoverageIgnoreStart
13require_once __DIR__ . '/../Maintenance.php';
14// @codeCoverageIgnoreEnd
15
22class AllTrans extends Maintenance {
23
24 public function __construct() {
25 parent::__construct();
26 $this->addDescription( 'Get all messages as defined by the English language file' );
27 }
28
29 public function execute() {
30 $localisationCache = $this->getServiceContainer()->getLocalisationCache();
31 $englishMessages = $localisationCache->getItem( 'en', 'messages' );
32 foreach ( $englishMessages as $key => $_ ) {
33 $this->output( "$key\n" );
34 }
35 }
36}
37
38// @codeCoverageIgnoreStart
39$maintClass = AllTrans::class;
40require_once RUN_MAINTENANCE_IF_MAIN;
41// @codeCoverageIgnoreEnd
$maintClass
Definition alltrans.php:39
Maintenance script that gets all messages as defined by the English language file.
Definition alltrans.php:22
__construct()
Default constructor.
Definition alltrans.php:24
execute()
Do the actual work.
Definition alltrans.php:29
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.