MediaWiki  master
rebuildrecentchanges.php
Go to the documentation of this file.
1 <?php
26 require_once __DIR__ . '/Maintenance.php';
27 
31 
39  private $cutoffFrom;
41  private $cutoffTo;
42 
43  public function __construct() {
44  parent::__construct();
45  $this->addDescription( 'Rebuild recent changes' );
46 
47  $this->addOption(
48  'from',
49  "Only rebuild rows in requested time range (in YYYYMMDDHHMMSS format)",
50  false,
51  true
52  );
53  $this->addOption(
54  'to',
55  "Only rebuild rows in requested time range (in YYYYMMDDHHMMSS format)",
56  false,
57  true
58  );
59  $this->setBatchSize( 200 );
60  }
61 
62  public function execute() {
63  if (
64  ( $this->hasOption( 'from' ) && !$this->hasOption( 'to' ) ) ||
65  ( !$this->hasOption( 'from' ) && $this->hasOption( 'to' ) )
66  ) {
67  $this->fatalError( "Both 'from' and 'to' must be given, or neither" );
68  }
69 
70  $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
71  $this->rebuildRecentChangesTablePass1( $lbFactory );
72  $this->rebuildRecentChangesTablePass2( $lbFactory );
73  $this->rebuildRecentChangesTablePass3( $lbFactory );
74  $this->rebuildRecentChangesTablePass4( $lbFactory );
75  $this->rebuildRecentChangesTablePass5( $lbFactory );
76  if ( !( $this->hasOption( 'from' ) && $this->hasOption( 'to' ) ) ) {
77  $this->purgeFeeds();
78  }
79  $this->output( "Done.\n" );
80  }
81 
87  private function rebuildRecentChangesTablePass1( ILBFactory $lbFactory ) {
88  $dbw = $this->getDB( DB_MASTER );
89  $commentStore = CommentStore::getStore();
90 
91  if ( $this->hasOption( 'from' ) && $this->hasOption( 'to' ) ) {
92  $this->cutoffFrom = wfTimestamp( TS_UNIX, $this->getOption( 'from' ) );
93  $this->cutoffTo = wfTimestamp( TS_UNIX, $this->getOption( 'to' ) );
94 
95  $sec = $this->cutoffTo - $this->cutoffFrom;
96  $days = $sec / 24 / 3600;
97  $this->output( "Rebuilding range of $sec seconds ($days days)\n" );
98  } else {
99  global $wgRCMaxAge;
100 
101  $days = $wgRCMaxAge / 24 / 3600;
102  $this->output( "Rebuilding \$wgRCMaxAge=$wgRCMaxAge seconds ($days days)\n" );
103 
104  $this->cutoffFrom = time() - $wgRCMaxAge;
105  $this->cutoffTo = time();
106  }
107 
108  $this->output( "Clearing recentchanges table for time range...\n" );
109  $rcids = $dbw->selectFieldValues(
110  'recentchanges',
111  'rc_id',
112  [
113  'rc_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffFrom ) ),
114  'rc_timestamp < ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) )
115  ]
116  );
117  foreach ( array_chunk( $rcids, $this->getBatchSize() ) as $rcidBatch ) {
118  $dbw->delete( 'recentchanges', [ 'rc_id' => $rcidBatch ], __METHOD__ );
119  $lbFactory->waitForReplication();
120  }
121 
122  $this->output( "Loading from page and revision tables...\n" );
123 
124  $commentQuery = $commentStore->getJoin( 'rev_comment' );
125  $actorQuery = ActorMigration::newMigration()->getJoin( 'rev_user' );
126  $res = $dbw->select(
127  [ 'revision', 'page' ] + $commentQuery['tables'] + $actorQuery['tables'],
128  [
129  'rev_timestamp',
130  'rev_minor_edit',
131  'rev_id',
132  'rev_deleted',
133  'page_namespace',
134  'page_title',
135  'page_is_new',
136  'page_id'
137  ] + $commentQuery['fields'] + $actorQuery['fields'],
138  [
139  'rev_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffFrom ) ),
140  'rev_timestamp < ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) )
141  ],
142  __METHOD__,
143  [ 'ORDER BY' => 'rev_timestamp DESC' ],
144  [
145  'page' => [ 'JOIN', 'rev_page=page_id' ],
146  ] + $commentQuery['joins'] + $actorQuery['joins']
147  );
148 
149  $this->output( "Inserting from page and revision tables...\n" );
150  $inserted = 0;
151  $actorMigration = ActorMigration::newMigration();
152  foreach ( $res as $row ) {
153  $comment = $commentStore->getComment( 'rev_comment', $row );
154  $user = User::newFromAnyId( $row->rev_user, $row->rev_user_text, $row->rev_actor );
155  $dbw->insert(
156  'recentchanges',
157  [
158  'rc_timestamp' => $row->rev_timestamp,
159  'rc_namespace' => $row->page_namespace,
160  'rc_title' => $row->page_title,
161  'rc_minor' => $row->rev_minor_edit,
162  'rc_bot' => 0,
163  'rc_new' => $row->page_is_new,
164  'rc_cur_id' => $row->page_id,
165  'rc_this_oldid' => $row->rev_id,
166  'rc_last_oldid' => 0, // is this ok?
167  'rc_type' => $row->page_is_new ? RC_NEW : RC_EDIT,
168  'rc_source' => $row->page_is_new ? RecentChange::SRC_NEW : RecentChange::SRC_EDIT,
169  'rc_deleted' => $row->rev_deleted
170  ] + $commentStore->insert( $dbw, 'rc_comment', $comment )
171  + $actorMigration->getInsertValues( $dbw, 'rc_user', $user ),
172  __METHOD__
173  );
174 
175  $rcid = $dbw->insertId();
176  $dbw->update(
177  'change_tag',
178  [ 'ct_rc_id' => $rcid ],
179  [ 'ct_rev_id' => $row->rev_id ],
180  __METHOD__
181  );
182 
183  if ( ( ++$inserted % $this->getBatchSize() ) == 0 ) {
184  $lbFactory->waitForReplication();
185  }
186  }
187  }
188 
195  private function rebuildRecentChangesTablePass2( ILBFactory $lbFactory ) {
196  $dbw = $this->getDB( DB_MASTER );
197 
198  $this->output( "Updating links and size differences...\n" );
199 
200  # Fill in the rc_last_oldid field, which points to the previous edit
201  $res = $dbw->select(
202  'recentchanges',
203  [ 'rc_cur_id', 'rc_this_oldid', 'rc_timestamp' ],
204  [
205  "rc_timestamp > " . $dbw->addQuotes( $dbw->timestamp( $this->cutoffFrom ) ),
206  "rc_timestamp < " . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) )
207  ],
208  __METHOD__,
209  [ 'ORDER BY' => [ 'rc_cur_id', 'rc_timestamp' ] ]
210  );
211 
212  $lastCurId = 0;
213  $lastOldId = 0;
214  $lastSize = null;
215  $updated = 0;
216  foreach ( $res as $row ) {
217  $new = 0;
218 
219  if ( $row->rc_cur_id != $lastCurId ) {
220  # Switch! Look up the previous last edit, if any
221  $lastCurId = intval( $row->rc_cur_id );
222  $emit = $row->rc_timestamp;
223 
224  $revRow = $dbw->selectRow(
225  'revision',
226  [ 'rev_id', 'rev_len' ],
227  [ 'rev_page' => $lastCurId, "rev_timestamp < " . $dbw->addQuotes( $emit ) ],
228  __METHOD__,
229  [ 'ORDER BY' => 'rev_timestamp DESC' ]
230  );
231  if ( $revRow ) {
232  $lastOldId = intval( $revRow->rev_id );
233  # Grab the last text size if available
234  $lastSize = $revRow->rev_len !== null ? intval( $revRow->rev_len ) : null;
235  } else {
236  # No previous edit
237  $lastOldId = 0;
238  $lastSize = 0;
239  $new = 1; // probably true
240  }
241  }
242 
243  if ( $lastCurId == 0 ) {
244  $this->output( "Uhhh, something wrong? No curid\n" );
245  } else {
246  # Grab the entry's text size
247  $size = (int)$dbw->selectField(
248  'revision',
249  'rev_len',
250  [ 'rev_id' => $row->rc_this_oldid ],
251  __METHOD__
252  );
253 
254  $dbw->update(
255  'recentchanges',
256  [
257  'rc_last_oldid' => $lastOldId,
258  'rc_new' => $new,
259  'rc_type' => $new ? RC_NEW : RC_EDIT,
260  'rc_source' => $new === 1 ? RecentChange::SRC_NEW : RecentChange::SRC_EDIT,
261  'rc_old_len' => $lastSize,
262  'rc_new_len' => $size,
263  ],
264  [
265  'rc_cur_id' => $lastCurId,
266  'rc_this_oldid' => $row->rc_this_oldid,
267  'rc_timestamp' => $row->rc_timestamp // index usage
268  ],
269  __METHOD__
270  );
271 
272  $lastOldId = intval( $row->rc_this_oldid );
273  $lastSize = $size;
274 
275  if ( ( ++$updated % $this->getBatchSize() ) == 0 ) {
276  $lbFactory->waitForReplication();
277  }
278  }
279  }
280  }
281 
287  private function rebuildRecentChangesTablePass3( ILBFactory $lbFactory ) {
289 
290  $dbw = $this->getDB( DB_MASTER );
291  $commentStore = CommentStore::getStore();
292  $nonRCLogs = array_merge( array_keys( $wgLogRestrictions ),
293  array_keys( $wgFilterLogTypes ),
294  [ 'create' ] );
295 
296  $this->output( "Loading from user and logging tables...\n" );
297 
298  $commentQuery = $commentStore->getJoin( 'log_comment' );
299  $actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
300  $res = $dbw->select(
301  [ 'logging' ] + $commentQuery['tables'] + $actorQuery['tables'],
302  [
303  'log_timestamp',
304  'log_namespace',
305  'log_title',
306  'log_page',
307  'log_type',
308  'log_action',
309  'log_id',
310  'log_params',
311  'log_deleted'
312  ] + $commentQuery['fields'] + $actorQuery['fields'],
313  [
314  'log_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffFrom ) ),
315  'log_timestamp < ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) ),
316  // Some logs don't go in RC since they are private, or are included in the filterable log types.
317  'log_type' => array_diff( LogPage::validTypes(), $nonRCLogs ),
318  ],
319  __METHOD__,
320  [ 'ORDER BY' => 'log_timestamp DESC' ],
321  $commentQuery['joins'] + $actorQuery['joins']
322  );
323 
324  $field = $dbw->fieldInfo( 'recentchanges', 'rc_cur_id' );
325 
326  $inserted = 0;
327  $actorMigration = ActorMigration::newMigration();
328  foreach ( $res as $row ) {
329  $comment = $commentStore->getComment( 'log_comment', $row );
330  $user = User::newFromAnyId( $row->log_user, $row->log_user_text, $row->log_actor );
331  $dbw->insert(
332  'recentchanges',
333  [
334  'rc_timestamp' => $row->log_timestamp,
335  'rc_namespace' => $row->log_namespace,
336  'rc_title' => $row->log_title,
337  'rc_minor' => 0,
338  'rc_bot' => 0,
339  'rc_patrolled' => $row->log_type == 'upload' ? 0 : 2,
340  'rc_new' => 0,
341  'rc_this_oldid' => 0,
342  'rc_last_oldid' => 0,
343  'rc_type' => RC_LOG,
344  'rc_source' => RecentChange::SRC_LOG,
345  'rc_cur_id' => $field->isNullable()
346  ? $row->log_page
347  : (int)$row->log_page, // NULL => 0,
348  'rc_log_type' => $row->log_type,
349  'rc_log_action' => $row->log_action,
350  'rc_logid' => $row->log_id,
351  'rc_params' => $row->log_params,
352  'rc_deleted' => $row->log_deleted
353  ] + $commentStore->insert( $dbw, 'rc_comment', $comment )
354  + $actorMigration->getInsertValues( $dbw, 'rc_user', $user ),
355  __METHOD__
356  );
357 
358  $rcid = $dbw->insertId();
359  $dbw->update(
360  'change_tag',
361  [ 'ct_rc_id' => $rcid ],
362  [ 'ct_log_id' => $row->log_id ],
363  __METHOD__
364  );
365 
366  if ( ( ++$inserted % $this->getBatchSize() ) == 0 ) {
367  $lbFactory->waitForReplication();
368  }
369  }
370  }
371 
377  private function rebuildRecentChangesTablePass4( ILBFactory $lbFactory ) {
379 
380  $dbw = $this->getDB( DB_MASTER );
381 
382  $userQuery = User::getQueryInfo();
383 
384  # @FIXME: recognize other bot account groups (not the same as users with 'bot' rights)
385  # @NOTE: users with 'bot' rights choose when edits are bot edits or not. That information
386  # may be lost at this point (aside from joining on the patrol log table entries).
387  $botgroups = [ 'bot' ];
388  $autopatrolgroups = ( $wgUseRCPatrol || $wgUseNPPatrol || $wgUseFilePatrol ) ?
389  MediaWikiServices::getInstance()->getPermissionManager()
390  ->getGroupsWithPermission( 'autopatrol' ) : [];
391 
392  # Flag our recent bot edits
393  if ( $botgroups ) {
394  $this->output( "Flagging bot account edits...\n" );
395 
396  # Find all users that are bots
397  $res = $dbw->select(
398  array_merge( [ 'user_groups' ], $userQuery['tables'] ),
399  $userQuery['fields'],
400  [ 'ug_group' => $botgroups ],
401  __METHOD__,
402  [ 'DISTINCT' ],
403  [ 'user_groups' => [ 'JOIN', 'user_id = ug_user' ] ] + $userQuery['joins']
404  );
405 
406  $botusers = [];
407  foreach ( $res as $row ) {
408  $botusers[] = User::newFromRow( $row );
409  }
410 
411  # Fill in the rc_bot field
412  if ( $botusers ) {
413  $actorQuery = ActorMigration::newMigration()->getWhere( $dbw, 'rc_user', $botusers, false );
414  $rcids = [];
415  foreach ( $actorQuery['orconds'] as $cond ) {
416  $rcids = array_merge( $rcids, $dbw->selectFieldValues(
417  [ 'recentchanges' ] + $actorQuery['tables'],
418  'rc_id',
419  [
420  "rc_timestamp > " . $dbw->addQuotes( $dbw->timestamp( $this->cutoffFrom ) ),
421  "rc_timestamp < " . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) ),
422  $cond,
423  ],
424  __METHOD__,
425  [],
426  $actorQuery['joins']
427  ) );
428  }
429  $rcids = array_values( array_unique( $rcids ) );
430 
431  foreach ( array_chunk( $rcids, $this->getBatchSize() ) as $rcidBatch ) {
432  $dbw->update(
433  'recentchanges',
434  [ 'rc_bot' => 1 ],
435  [ 'rc_id' => $rcidBatch ],
436  __METHOD__
437  );
438  $lbFactory->waitForReplication();
439  }
440  }
441  }
442 
443  # Flag our recent autopatrolled edits
444  if ( !$wgMiserMode && $autopatrolgroups ) {
445  $patrolusers = [];
446 
447  $this->output( "Flagging auto-patrolled edits...\n" );
448 
449  # Find all users in RC with autopatrol rights
450  $res = $dbw->select(
451  array_merge( [ 'user_groups' ], $userQuery['tables'] ),
452  $userQuery['fields'],
453  [ 'ug_group' => $autopatrolgroups ],
454  __METHOD__,
455  [ 'DISTINCT' ],
456  [ 'user_groups' => [ 'JOIN', 'user_id = ug_user' ] ] + $userQuery['joins']
457  );
458 
459  foreach ( $res as $row ) {
460  $patrolusers[] = User::newFromRow( $row );
461  }
462 
463  # Fill in the rc_patrolled field
464  if ( $patrolusers ) {
465  $actorQuery = ActorMigration::newMigration()->getWhere( $dbw, 'rc_user', $patrolusers, false );
466  foreach ( $actorQuery['orconds'] as $cond ) {
467  $conds = [
468  $cond,
469  'rc_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffFrom ) ),
470  'rc_timestamp < ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) ),
471  'rc_patrolled' => 0
472  ];
473 
474  if ( !$wgUseRCPatrol ) {
475  $subConds = [];
476  if ( $wgUseNPPatrol ) {
477  $subConds[] = 'rc_source = ' . $dbw->addQuotes( RecentChange::SRC_NEW );
478  }
479  if ( $wgUseFilePatrol ) {
480  $subConds[] = 'rc_log_type = ' . $dbw->addQuotes( 'upload' );
481  }
482  $conds[] = $dbw->makeList( $subConds, IDatabase::LIST_OR );
483  }
484 
485  $dbw->update(
486  'recentchanges',
487  [ 'rc_patrolled' => 2 ],
488  $conds,
489  __METHOD__
490  );
491  $lbFactory->waitForReplication();
492  }
493  }
494  }
495  }
496 
503  private function rebuildRecentChangesTablePass5( ILBFactory $lbFactory ) {
504  $dbw = wfGetDB( DB_MASTER );
505 
506  $this->output( "Removing duplicate revision and logging entries...\n" );
507 
508  $res = $dbw->select(
509  [ 'logging', 'log_search' ],
510  [ 'ls_value', 'ls_log_id' ],
511  [
512  'ls_log_id = log_id',
513  'ls_field' => 'associated_rev_id',
514  'log_type != ' . $dbw->addQuotes( 'create' ),
515  'log_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffFrom ) ),
516  'log_timestamp < ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) ),
517  ],
518  __METHOD__
519  );
520 
521  $updates = 0;
522  foreach ( $res as $row ) {
523  $rev_id = $row->ls_value;
524  $log_id = $row->ls_log_id;
525 
526  // Mark the logging row as having an associated rev id
527  $dbw->update(
528  'recentchanges',
529  /*SET*/ [ 'rc_this_oldid' => $rev_id ],
530  /*WHERE*/ [ 'rc_logid' => $log_id ],
531  __METHOD__
532  );
533 
534  // Delete the revision row
535  $dbw->delete(
536  'recentchanges',
537  /*WHERE*/ [ 'rc_this_oldid' => $rev_id, 'rc_logid' => 0 ],
538  __METHOD__
539  );
540 
541  if ( ( ++$updates % $this->getBatchSize() ) == 0 ) {
542  $lbFactory->waitForReplication();
543  }
544  }
545  }
546 
550  private function purgeFeeds() {
551  global $wgFeedClasses;
552 
553  $this->output( "Deleting feed timestamps.\n" );
554 
555  $wanCache = MediaWikiServices::getInstance()->getMainWANObjectCache();
556  foreach ( $wgFeedClasses as $feed => $className ) {
557  $wanCache->delete( $wanCache->makeKey( 'rcfeed', $feed, 'timestamp' ) ); # Good enough for now.
558  }
559  }
560 }
561 
562 $maintClass = RebuildRecentchanges::class;
563 require_once RUN_MAINTENANCE_IF_MAIN;
RebuildRecentchanges\$cutoffTo
int $cutoffTo
UNIX timestamp.
Definition: rebuildrecentchanges.php:41
RUN_MAINTENANCE_IF_MAIN
const RUN_MAINTENANCE_IF_MAIN
Definition: Maintenance.php:38
LogPage\validTypes
static validTypes()
Get the list of valid log types.
Definition: LogPage.php:198
RebuildRecentchanges\rebuildRecentChangesTablePass3
rebuildRecentChangesTablePass3(ILBFactory $lbFactory)
Rebuild pass 3: Insert recentchanges entries for action logs.
Definition: rebuildrecentchanges.php:287
Wikimedia\Rdbms\ILBFactory\waitForReplication
waitForReplication(array $opts=[])
Waits for the replica DBs to catch up to the current master position.
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:146
Maintenance\fatalError
fatalError( $msg, $exitCode=1)
Output a message and terminate the current script.
Definition: Maintenance.php:480
Maintenance\addDescription
addDescription( $text)
Set the description text.
Definition: Maintenance.php:323
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:1806
RC_LOG
const RC_LOG
Definition: Defines.php:133
RC_EDIT
const RC_EDIT
Definition: Defines.php:131
RebuildRecentchanges\execute
execute()
Do the actual work.
Definition: rebuildrecentchanges.php:62
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition: Maintenance.php:53
$res
$res
Definition: testCompression.php:57
User\newFromRow
static newFromRow( $row, $data=null)
Create a new user object from a user row.
Definition: User.php:716
$wgUseRCPatrol
$wgUseRCPatrol
Use RC Patrolling to check for vandalism (from recent changes and watchlists) New pages and new files...
Definition: DefaultSettings.php:7264
$wgUseNPPatrol
$wgUseNPPatrol
Use new page patrolling to check new pages on Special:Newpages.
Definition: DefaultSettings.php:7280
RecentChange\SRC_LOG
const SRC_LOG
Definition: RecentChange.php:76
ActorMigration\newMigration
static newMigration()
Static constructor.
Definition: ActorMigration.php:139
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
RebuildRecentchanges\rebuildRecentChangesTablePass4
rebuildRecentChangesTablePass4(ILBFactory $lbFactory)
Rebuild pass 4: Mark bot and autopatrolled entries.
Definition: rebuildrecentchanges.php:377
LIST_OR
const LIST_OR
Definition: Defines.php:51
$wgFilterLogTypes
$wgFilterLogTypes
Show/hide links on Special:Log will be shown for these log types.
Definition: DefaultSettings.php:8100
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2463
$maintClass
$maintClass
Definition: rebuildrecentchanges.php:562
Maintenance\addOption
addOption( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false)
Add a parameter to the script.
Definition: Maintenance.php:241
RecentChange\SRC_EDIT
const SRC_EDIT
Definition: RecentChange.php:74
User\newFromAnyId
static newFromAnyId( $userId, $userName, $actorId, $dbDomain=false)
Static factory method for creation from an ID, name, and/or actor ID.
Definition: User.php:616
DB_MASTER
const DB_MASTER
Definition: defines.php:26
RecentChange\SRC_NEW
const SRC_NEW
Definition: RecentChange.php:75
$wgFeedClasses
$wgFeedClasses
Available feeds objects.
Definition: DefaultSettings.php:7339
$wgUseFilePatrol
$wgUseFilePatrol
Use file patrolling to check new files on Special:Newfiles.
Definition: DefaultSettings.php:7291
RebuildRecentchanges
Maintenance script that rebuilds recent changes from scratch.
Definition: rebuildrecentchanges.php:37
RebuildRecentchanges\rebuildRecentChangesTablePass2
rebuildRecentChangesTablePass2(ILBFactory $lbFactory)
Rebuild pass 2: Enhance entries for page revisions with references to the previous revision (rc_last_...
Definition: rebuildrecentchanges.php:195
$wgLogRestrictions
$wgLogRestrictions
This restricts log access to those who have a certain right Users without this will not see it in the...
Definition: DefaultSettings.php:8077
$wgRCMaxAge
$wgRCMaxAge
Recentchanges items are periodically purged; entries older than this many seconds will go.
Definition: DefaultSettings.php:7131
Maintenance\getDB
getDB( $db, $groups=[], $dbDomain=false)
Returns a database to be used by current maintenance script.
Definition: Maintenance.php:1350
RC_NEW
const RC_NEW
Definition: Defines.php:132
User\getQueryInfo
static getQueryInfo()
Return the tables, fields, and join conditions to be selected to create a new user object.
Definition: User.php:4775
$wgMiserMode
$wgMiserMode
Disable database-intensive features.
Definition: DefaultSettings.php:2347
Maintenance\getOption
getOption( $name, $default=null)
Get an option, or return the default.
Definition: Maintenance.php:277
RebuildRecentchanges\$cutoffFrom
int $cutoffFrom
UNIX timestamp.
Definition: rebuildrecentchanges.php:39
Maintenance\getBatchSize
getBatchSize()
Returns batch size.
Definition: Maintenance.php:362
RebuildRecentchanges\rebuildRecentChangesTablePass5
rebuildRecentChangesTablePass5(ILBFactory $lbFactory)
Rebuild pass 5: Delete duplicate entries where we generate both a page revision and a log entry for a...
Definition: rebuildrecentchanges.php:503
Maintenance\output
output( $out, $channel=null)
Throw some output to the user.
Definition: Maintenance.php:429
Maintenance\hasOption
hasOption( $name)
Checks to see if a particular option exists.
Definition: Maintenance.php:262
CommentStore\getStore
static getStore()
Definition: CommentStore.php:109
RebuildRecentchanges\__construct
__construct()
Default constructor.
Definition: rebuildrecentchanges.php:43
RebuildRecentchanges\purgeFeeds
purgeFeeds()
Purge cached feeds in $wanCache.
Definition: rebuildrecentchanges.php:550
Maintenance\setBatchSize
setBatchSize( $s=0)
Set the batch size.
Definition: Maintenance.php:370
Wikimedia\Rdbms\ILBFactory
An interface for generating database load balancers.
Definition: ILBFactory.php:33
RebuildRecentchanges\rebuildRecentChangesTablePass1
rebuildRecentChangesTablePass1(ILBFactory $lbFactory)
Rebuild pass 1: Insert recentchanges entries for page revisions.
Definition: rebuildrecentchanges.php:87