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