Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
createMessageIndex.php
Go to the documentation of this file.
1<?php
14
15// Standard boilerplate to define $IP
16if ( getenv( 'MW_INSTALL_PATH' ) !== false ) {
17 $IP = getenv( 'MW_INSTALL_PATH' );
18} else {
19 $dir = __DIR__;
20 $IP = "$dir/../../..";
21}
22require_once "$IP/maintenance/Maintenance.php";
23
24class CreateMessageIndex extends Maintenance {
25 public function __construct() {
26 parent::__construct();
27 $this->addDescription( 'Creates or updates a message index.' );
28 $this->requireExtension( 'Translate' );
29 }
30
31 public function execute() {
32 MessageGroups::singleton()->recache();
33 Services::getInstance()->getMessageIndex()->rebuild();
34 }
35}
36
37$maintClass = CreateMessageIndex::class;
38require_once RUN_MAINTENANCE_IF_MAIN;
Factory class for accessing message groups individually by id or all of them as a list.
Minimal service container.
Definition Services.php:58