jenkins-bot has submitted this change and it was merged. Change subject: Update createMessageIndex.php to use Maintenance class ......................................................................
Update createMessageIndex.php to use Maintenance class Also removed 2 STDOUT calls from MessageIndex.php. Change-Id: Ic366f29ef1a8444ad952e6f82b3f8d1c308f4351 --- M scripts/createMessageIndex.php M utils/MessageIndex.php 2 files changed, 19 insertions(+), 23 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/createMessageIndex.php b/scripts/createMessageIndex.php index c3fdf4d..f1ae2fa 100644 --- a/scripts/createMessageIndex.php +++ b/scripts/createMessageIndex.php @@ -11,26 +11,26 @@ * @file */ -require __DIR__ . '/cli.inc'; +// Standard boilerplate to define $IP +if ( getenv( 'MW_INSTALL_PATH' ) !== false ) { + $IP = getenv( 'MW_INSTALL_PATH' ); +} else { + $dir = __DIR__; + $IP = "$dir/../../.."; +} +require_once "$IP/maintenance/Maintenance.php"; -function showUsage() { - STDERR( <<<EOT -Message index creation command line script +class CreateMessageIndex extends Maintenance { + public function __construct() { + parent::__construct(); + $this->mDescription = 'Creates or updates a message index.'; + } -Usage: php createMessageIndex.php [options...] - -Options: - --help Show this help text - --quiet Only output errors - -EOT - ); - exit( 1 ); + public function execute() { + MessageGroups::clearCache(); + MessageIndex::singleton()->rebuild(); + } } -if ( isset( $options['help'] ) ) { - showUsage(); -} - -MessageGroups::clearCache(); -MessageIndex::singleton()->rebuild(); +$maintClass = 'CreateMessageIndex'; +require_once DO_MAINTENANCE; diff --git a/utils/MessageIndex.php b/utils/MessageIndex.php index 708da2c..3796e3b 100644 --- a/utils/MessageIndex.php +++ b/utils/MessageIndex.php @@ -103,8 +103,6 @@ $old = $this->retrieve(); $postponed = array(); - STDOUT( "Working with ", 'main' ); - /** * @var MessageGroup $g */ @@ -198,8 +196,6 @@ } $id = $g->getId(); - - STDOUT( "$id ", 'main' ); $namespace = $g->getNamespace(); -- To view, visit https://gerrit.wikimedia.org/r/88957 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic366f29ef1a8444ad952e6f82b3f8d1c308f4351 Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Siebrand <siebr...@wikimedia.org> Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: Siebrand <siebr...@wikimedia.org> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits