Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
createMessageIndex.php
Go to the documentation of this file.
1<?php
14use MediaWiki\Maintenance\Maintenance;
15
16// Standard boilerplate to define $IP
17if ( getenv( 'MW_INSTALL_PATH' ) !== false ) {
18 $IP = getenv( 'MW_INSTALL_PATH' );
19} else {
20 $dir = __DIR__;
21 $IP = "$dir/../../..";
22}
23require_once "$IP/maintenance/Maintenance.php";
24
25class CreateMessageIndex extends Maintenance {
26 public function __construct() {
27 parent::__construct();
28 $this->addDescription( 'Creates or updates a message index.' );
29 $this->requireExtension( 'Translate' );
30 }
31
32 public function execute() {
33 MessageGroups::singleton()->recache();
34 Services::getInstance()->getMessageIndex()->rebuild();
35 }
36}
37
38$maintClass = CreateMessageIndex::class;
39require_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:59