mDescription = 'Ensure all translation pages are up to date.'; $this->setBatchSize( 300 ); $this->addOption( 'jobqueue', 'Use JobQueue (asynchronous)' ); } public function execute() { $groups = MessageGroups::singleton()->getGroups(); $counter = 0; $useJobQueue = $this->hasOption( 'jobqueue' ); /** @var MessageGroup $group */ foreach ( $groups as $group ) { if ( !$group instanceof WikiPageMessageGroup ) { continue; } $counter++; if ( ( $counter % $this->mBatchSize ) === 0 ) { wfWaitForSlaves(); } $page = TranslatablePage::newFromTitle( $group->getTitle() ); $jobs = TranslationsUpdateJob::getRenderJobs( $page ); if ( $useJobQueue ) { JobQueueGroup::singleton()->push( $jobs ); } else { foreach ( $jobs as $job ) { $job->run(); } } } if ( $useJobQueue ) { $this->output( "Queued refresh for $counter translatable pages.\n" ); } else { $this->output( "Refreshed $counter translatable pages.\n" ); } } } $maintClass = RefreshTranslatablePages::class; require_once RUN_MAINTENANCE_IF_MAIN;