MediaWiki  1.31.0
rebuildrecentchanges.php
Go to the documentation of this file.
1 <?php
26 require_once __DIR__ . '/Maintenance.php';
27 
30 
38  private $cutoffFrom;
40  private $cutoffTo;
41 
42  public function __construct() {
43  parent::__construct();
44  $this->addDescription( 'Rebuild recent changes' );
45 
46  $this->addOption(
47  'from',
48  "Only rebuild rows in requested time range (in YYYYMMDDHHMMSS format)",
49  false,
50  true
51  );
52  $this->addOption(
53  'to',
54  "Only rebuild rows in requested time range (in YYYYMMDDHHMMSS format)",
55  false,
56  true
57  );
58  $this->setBatchSize( 200 );
59  }
60 
61  public function execute() {
62  if (
63  ( $this->hasOption( 'from' ) && !$this->hasOption( 'to' ) ) ||
64  ( !$this->hasOption( 'from' ) && $this->hasOption( 'to' ) )
65  ) {
66  $this->fatalError( "Both 'from' and 'to' must be given, or neither" );
67  }
68 
69  $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
70  $this->rebuildRecentChangesTablePass1( $lbFactory );
71  $this->rebuildRecentChangesTablePass2( $lbFactory );
72  $this->rebuildRecentChangesTablePass3( $lbFactory );
73  $this->rebuildRecentChangesTablePass4( $lbFactory );
74  $this->rebuildRecentChangesTablePass5( $lbFactory );
75  if ( !( $this->hasOption( 'from' ) && $this->hasOption( 'to' ) ) ) {
76  $this->purgeFeeds();
77  }
78  $this->output( "Done.\n" );
79  }
80 
84  private function rebuildRecentChangesTablePass1( ILBFactory $lbFactory ) {
85  $dbw = $this->getDB( DB_MASTER );
86  $commentStore = CommentStore::getStore();
87 
88  if ( $this->hasOption( 'from' ) && $this->hasOption( 'to' ) ) {
89  $this->cutoffFrom = wfTimestamp( TS_UNIX, $this->getOption( 'from' ) );
90  $this->cutoffTo = wfTimestamp( TS_UNIX, $this->getOption( 'to' ) );
91 
92  $sec = $this->cutoffTo - $this->cutoffFrom;
93  $days = $sec / 24 / 3600;
94  $this->output( "Rebuilding range of $sec seconds ($days days)\n" );
95  } else {
97 
98  $days = $wgRCMaxAge / 24 / 3600;
99  $this->output( "Rebuilding \$wgRCMaxAge=$wgRCMaxAge seconds ($days days)\n" );
100 
101  $this->cutoffFrom = time() - $wgRCMaxAge;
102  $this->cutoffTo = time();
103  }
104 
105  $this->output( "Clearing recentchanges table for time range...\n" );
106  $rcids = $dbw->selectFieldValues(
107  'recentchanges',
108  'rc_id',
109  [
110  'rc_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffFrom ) ),
111  'rc_timestamp < ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) )
112  ]
113  );
114  foreach ( array_chunk( $rcids, $this->getBatchSize() ) as $rcidBatch ) {
115  $dbw->delete( 'recentchanges', [ 'rc_id' => $rcidBatch ], __METHOD__ );
116  $lbFactory->waitForReplication();
117  }
118 
119  $this->output( "Loading from page and revision tables...\n" );
120 
121  $commentQuery = $commentStore->getJoin( 'rev_comment' );
122  $actorQuery = ActorMigration::newMigration()->getJoin( 'rev_user' );
123  $res = $dbw->select(
124  [ 'revision', 'page' ] + $commentQuery['tables'] + $actorQuery['tables'],
125  [
126  'rev_timestamp',
127  'rev_minor_edit',
128  'rev_id',
129  'rev_deleted',
130  'page_namespace',
131  'page_title',
132  'page_is_new',
133  'page_id'
134  ] + $commentQuery['fields'] + $actorQuery['fields'],
135  [
136  'rev_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffFrom ) ),
137  'rev_timestamp < ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) )
138  ],
139  __METHOD__,
140  [ 'ORDER BY' => 'rev_timestamp DESC' ],
141  [
142  'page' => [ 'JOIN', 'rev_page=page_id' ],
143  ] + $commentQuery['joins'] + $actorQuery['joins']
144  );
145 
146  $this->output( "Inserting from page and revision tables...\n" );
147  $inserted = 0;
148  $actorMigration = ActorMigration::newMigration();
149  foreach ( $res as $row ) {
150  $comment = $commentStore->getComment( 'rev_comment', $row );
151  $user = User::newFromAnyId( $row->rev_user, $row->rev_user_text, $row->rev_actor );
152  $dbw->insert(
153  'recentchanges',
154  [
155  'rc_timestamp' => $row->rev_timestamp,
156  'rc_namespace' => $row->page_namespace,
157  'rc_title' => $row->page_title,
158  'rc_minor' => $row->rev_minor_edit,
159  'rc_bot' => 0,
160  'rc_new' => $row->page_is_new,
161  'rc_cur_id' => $row->page_id,
162  'rc_this_oldid' => $row->rev_id,
163  'rc_last_oldid' => 0, // is this ok?
164  'rc_type' => $row->page_is_new ? RC_NEW : RC_EDIT,
165  'rc_source' => $row->page_is_new ? RecentChange::SRC_NEW : RecentChange::SRC_EDIT,
166  'rc_deleted' => $row->rev_deleted
167  ] + $commentStore->insert( $dbw, 'rc_comment', $comment )
168  + $actorMigration->getInsertValues( $dbw, 'rc_user', $user ),
169  __METHOD__
170  );
171  if ( ( ++$inserted % $this->getBatchSize() ) == 0 ) {
172  $lbFactory->waitForReplication();
173  }
174  }
175  }
176 
181  private function rebuildRecentChangesTablePass2( ILBFactory $lbFactory ) {
182  $dbw = $this->getDB( DB_MASTER );
183 
184  $this->output( "Updating links and size differences...\n" );
185 
186  # Fill in the rc_last_oldid field, which points to the previous edit
187  $res = $dbw->select(
188  'recentchanges',
189  [ 'rc_cur_id', 'rc_this_oldid', 'rc_timestamp' ],
190  [
191  "rc_timestamp > " . $dbw->addQuotes( $dbw->timestamp( $this->cutoffFrom ) ),
192  "rc_timestamp < " . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) )
193  ],
194  __METHOD__,
195  [ 'ORDER BY' => 'rc_cur_id,rc_timestamp' ]
196  );
197 
198  $lastCurId = 0;
199  $lastOldId = 0;
200  $lastSize = null;
201  $updated = 0;
202  foreach ( $res as $obj ) {
203  $new = 0;
204 
205  if ( $obj->rc_cur_id != $lastCurId ) {
206  # Switch! Look up the previous last edit, if any
207  $lastCurId = intval( $obj->rc_cur_id );
208  $emit = $obj->rc_timestamp;
209 
210  $row = $dbw->selectRow(
211  'revision',
212  [ 'rev_id', 'rev_len' ],
213  [ 'rev_page' => $lastCurId, "rev_timestamp < " . $dbw->addQuotes( $emit ) ],
214  __METHOD__,
215  [ 'ORDER BY' => 'rev_timestamp DESC' ]
216  );
217  if ( $row ) {
218  $lastOldId = intval( $row->rev_id );
219  # Grab the last text size if available
220  $lastSize = !is_null( $row->rev_len ) ? intval( $row->rev_len ) : null;
221  } else {
222  # No previous edit
223  $lastOldId = 0;
224  $lastSize = null;
225  $new = 1; // probably true
226  }
227  }
228 
229  if ( $lastCurId == 0 ) {
230  $this->output( "Uhhh, something wrong? No curid\n" );
231  } else {
232  # Grab the entry's text size
233  $size = (int)$dbw->selectField(
234  'revision',
235  'rev_len',
236  [ 'rev_id' => $obj->rc_this_oldid ],
237  __METHOD__
238  );
239 
240  $dbw->update(
241  'recentchanges',
242  [
243  'rc_last_oldid' => $lastOldId,
244  'rc_new' => $new,
245  'rc_type' => $new ? RC_NEW : RC_EDIT,
246  'rc_source' => $new === 1 ? RecentChange::SRC_NEW : RecentChange::SRC_EDIT,
247  'rc_old_len' => $lastSize,
248  'rc_new_len' => $size,
249  ],
250  [
251  'rc_cur_id' => $lastCurId,
252  'rc_this_oldid' => $obj->rc_this_oldid,
253  'rc_timestamp' => $obj->rc_timestamp // index usage
254  ],
255  __METHOD__
256  );
257 
258  $lastOldId = intval( $obj->rc_this_oldid );
259  $lastSize = $size;
260 
261  if ( ( ++$updated % $this->getBatchSize() ) == 0 ) {
262  $lbFactory->waitForReplication();
263  }
264  }
265  }
266  }
267 
271  private function rebuildRecentChangesTablePass3( ILBFactory $lbFactory ) {
273 
274  $dbw = $this->getDB( DB_MASTER );
275  $commentStore = CommentStore::getStore();
276 
277  $this->output( "Loading from user, page, and logging tables...\n" );
278 
279  $commentQuery = $commentStore->getJoin( 'log_comment' );
280  $actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
281  $res = $dbw->select(
282  [ 'logging', 'page' ] + $commentQuery['tables'] + $actorQuery['tables'],
283  [
284  'log_timestamp',
285  'log_namespace',
286  'log_title',
287  'page_id',
288  'log_type',
289  'log_action',
290  'log_id',
291  'log_params',
292  'log_deleted'
293  ] + $commentQuery['fields'] + $actorQuery['fields'],
294  [
295  'log_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffFrom ) ),
296  'log_timestamp < ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) ),
297  // Some logs don't go in RC since they are private.
298  // @FIXME: core/extensions also have spammy logs that don't go in RC.
299  'log_type' => array_diff( $wgLogTypes, array_keys( $wgLogRestrictions ) ),
300  ],
301  __METHOD__,
302  [ 'ORDER BY' => 'log_timestamp DESC' ],
303  [
304  'page' =>
305  [ 'LEFT JOIN', [ 'log_namespace=page_namespace', 'log_title=page_title' ] ]
306  ] + $commentQuery['joins'] + $actorQuery['joins']
307  );
308 
309  $field = $dbw->fieldInfo( 'recentchanges', 'rc_cur_id' );
310 
311  $inserted = 0;
312  $actorMigration = ActorMigration::newMigration();
313  foreach ( $res as $row ) {
314  $comment = $commentStore->getComment( 'log_comment', $row );
315  $user = User::newFromAnyId( $row->log_user, $row->log_user_text, $row->log_actor );
316  $dbw->insert(
317  'recentchanges',
318  [
319  'rc_timestamp' => $row->log_timestamp,
320  'rc_namespace' => $row->log_namespace,
321  'rc_title' => $row->log_title,
322  'rc_minor' => 0,
323  'rc_bot' => 0,
324  'rc_patrolled' => 1,
325  'rc_new' => 0,
326  'rc_this_oldid' => 0,
327  'rc_last_oldid' => 0,
328  'rc_type' => RC_LOG,
329  'rc_source' => RecentChange::SRC_LOG,
330  'rc_cur_id' => $field->isNullable()
331  ? $row->page_id
332  : (int)$row->page_id, // NULL => 0,
333  'rc_log_type' => $row->log_type,
334  'rc_log_action' => $row->log_action,
335  'rc_logid' => $row->log_id,
336  'rc_params' => $row->log_params,
337  'rc_deleted' => $row->log_deleted
338  ] + $commentStore->insert( $dbw, 'rc_comment', $comment )
339  + $actorMigration->getInsertValues( $dbw, 'rc_user', $user ),
340  __METHOD__
341  );
342 
343  if ( ( ++$inserted % $this->getBatchSize() ) == 0 ) {
344  $lbFactory->waitForReplication();
345  }
346  }
347  }
348 
352  private function rebuildRecentChangesTablePass4( ILBFactory $lbFactory ) {
354 
355  $dbw = $this->getDB( DB_MASTER );
356 
357  $userQuery = User::getQueryInfo();
358 
359  # @FIXME: recognize other bot account groups (not the same as users with 'bot' rights)
360  # @NOTE: users with 'bot' rights choose when edits are bot edits or not. That information
361  # may be lost at this point (aside from joining on the patrol log table entries).
362  $botgroups = [ 'bot' ];
363  $autopatrolgroups = $wgUseRCPatrol ? User::getGroupsWithPermission( 'autopatrol' ) : [];
364 
365  # Flag our recent bot edits
366  if ( $botgroups ) {
367  $this->output( "Flagging bot account edits...\n" );
368 
369  # Find all users that are bots
370  $res = $dbw->select(
371  array_merge( [ 'user_groups' ], $userQuery['tables'] ),
372  $userQuery['fields'],
373  [ 'ug_group' => $botgroups ],
374  __METHOD__,
375  [ 'DISTINCT' ],
376  [ 'user_group' => [ 'JOIN', 'user_id = ug_user' ] ] + $userQuery['joins']
377  );
378 
379  $botusers = [];
380  foreach ( $res as $obj ) {
381  $botusers[] = User::newFromRow( $obj );
382  }
383 
384  # Fill in the rc_bot field
385  if ( $botusers ) {
386  $actorQuery = ActorMigration::newMigration()->getWhere( $dbw, 'rc_user', $botusers, false );
387  $rcids = [];
388  foreach ( $actorQuery['orconds'] as $cond ) {
389  $rcids = array_merge( $rcids, $dbw->selectFieldValues(
390  [ 'recentchanges' ] + $actorQuery['tables'],
391  'rc_id',
392  [
393  "rc_timestamp > " . $dbw->addQuotes( $dbw->timestamp( $this->cutoffFrom ) ),
394  "rc_timestamp < " . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) ),
395  $cond,
396  ],
397  __METHOD__,
398  [],
399  $actorQuery['joins']
400  ) );
401  }
402  $rcids = array_values( array_unique( $rcids ) );
403 
404  foreach ( array_chunk( $rcids, $this->getBatchSize() ) as $rcidBatch ) {
405  $dbw->update(
406  'recentchanges',
407  [ 'rc_bot' => 1 ],
408  [ 'rc_id' => $rcidBatch ],
409  __METHOD__
410  );
411  $lbFactory->waitForReplication();
412  }
413  }
414  }
415 
416  # Flag our recent autopatrolled edits
417  if ( !$wgMiserMode && $autopatrolgroups ) {
418  $patrolusers = [];
419 
420  $this->output( "Flagging auto-patrolled edits...\n" );
421 
422  # Find all users in RC with autopatrol rights
423  $res = $dbw->select(
424  array_merge( [ 'user_groups' ], $userQuery['tables'] ),
425  $userQuery['fields'],
426  [ 'ug_group' => $autopatrolgroups ],
427  __METHOD__,
428  [ 'DISTINCT' ],
429  [ 'user_group' => [ 'JOIN', 'user_id = ug_user' ] ] + $userQuery['joins']
430  );
431 
432  foreach ( $res as $obj ) {
433  $patrolusers[] = User::newFromRow( $obj );
434  }
435 
436  # Fill in the rc_patrolled field
437  if ( $patrolusers ) {
438  $actorQuery = ActorMigration::newMigration()->getWhere( $dbw, 'rc_user', $patrolusers, false );
439  foreach ( $actorQuery['orconds'] as $cond ) {
440  $dbw->update(
441  'recentchanges',
442  [ 'rc_patrolled' => 1 ],
443  [
444  $cond,
445  'rc_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffFrom ) ),
446  'rc_timestamp < ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) ),
447  ],
448  __METHOD__
449  );
450  $lbFactory->waitForReplication();
451  }
452  }
453  }
454  }
455 
460  private function rebuildRecentChangesTablePass5( ILBFactory $lbFactory ) {
461  $dbw = wfGetDB( DB_MASTER );
462 
463  $this->output( "Removing duplicate revision and logging entries...\n" );
464 
465  $res = $dbw->select(
466  [ 'logging', 'log_search' ],
467  [ 'ls_value', 'ls_log_id' ],
468  [
469  'ls_log_id = log_id',
470  'ls_field' => 'associated_rev_id',
471  'log_type' => 'upload',
472  'log_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffFrom ) ),
473  'log_timestamp < ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) ),
474  ],
475  __METHOD__
476  );
477 
478  $updates = 0;
479  foreach ( $res as $obj ) {
480  $rev_id = $obj->ls_value;
481  $log_id = $obj->ls_log_id;
482 
483  // Mark the logging row as having an associated rev id
484  $dbw->update(
485  'recentchanges',
486  /*SET*/ [ 'rc_this_oldid' => $rev_id ],
487  /*WHERE*/ [ 'rc_logid' => $log_id ],
488  __METHOD__
489  );
490 
491  // Delete the revision row
492  $dbw->delete(
493  'recentchanges',
494  /*WHERE*/ [ 'rc_this_oldid' => $rev_id, 'rc_logid' => 0 ],
495  __METHOD__
496  );
497 
498  if ( ( ++$updates % $this->getBatchSize() ) == 0 ) {
499  $lbFactory->waitForReplication();
500  }
501  }
502  }
503 
507  private function purgeFeeds() {
509 
510  $this->output( "Deleting feed timestamps.\n" );
511 
512  $wanCache = MediaWikiServices::getInstance()->getMainWANObjectCache();
513  foreach ( $wgFeedClasses as $feed => $className ) {
514  $wanCache->delete( $wanCache->makeKey( 'rcfeed', $feed, 'timestamp' ) ); # Good enough for now.
515  }
516  }
517 }
518 
520 require_once RUN_MAINTENANCE_IF_MAIN;
RebuildRecentchanges\$cutoffTo
int $cutoffTo
UNIX timestamp.
Definition: rebuildrecentchanges.php:40
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:244
RebuildRecentchanges\rebuildRecentChangesTablePass3
rebuildRecentChangesTablePass3(ILBFactory $lbFactory)
Rebuild pass 3: Insert recentchanges entries for action logs.
Definition: rebuildrecentchanges.php:271
Wikimedia\Rdbms\ILBFactory\waitForReplication
waitForReplication(array $opts=[])
Waits for the replica DBs to catch up to the current master position.
Maintenance\fatalError
fatalError( $msg, $exitCode=1)
Output a message and terminate the current script.
Definition: Maintenance.php:439
Maintenance\addDescription
addDescription( $text)
Set the description text.
Definition: Maintenance.php:291
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:1968
RC_LOG
const RC_LOG
Definition: Defines.php:145
use
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
RUN_MAINTENANCE_IF_MAIN
require_once RUN_MAINTENANCE_IF_MAIN
Definition: maintenance.txt:50
RC_EDIT
const RC_EDIT
Definition: Defines.php:143
RebuildRecentchanges\execute
execute()
Do the actual work.
Definition: rebuildrecentchanges.php:61
User\newFromAnyId
static newFromAnyId( $userId, $userName, $actorId)
Static factory method for creation from an ID, name, and/or actor ID.
Definition: User.php:657
$res
$res
Definition: database.txt:21
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition: maintenance.txt:39
User\newFromRow
static newFromRow( $row, $data=null)
Create a new user object from a user row.
Definition: User.php:750
$wgUseRCPatrol
$wgUseRCPatrol
Use RC Patrolling to check for vandalism (from recent changes and watchlists) New pages and new files...
Definition: DefaultSettings.php:6804
RecentChange\SRC_LOG
const SRC_LOG
Definition: RecentChange.php:73
ActorMigration\newMigration
static newMigration()
Static constructor.
Definition: ActorMigration.php:89
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
RebuildRecentchanges\rebuildRecentChangesTablePass4
rebuildRecentChangesTablePass4(ILBFactory $lbFactory)
Rebuild pass 4: Mark bot and autopatrolled entries.
Definition: rebuildrecentchanges.php:352
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2800
$maintClass
$maintClass
Definition: rebuildrecentchanges.php:519
Maintenance\addOption
addOption( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false)
Add a parameter to the script.
Definition: Maintenance.php:219
$wgLogTypes
$wgLogTypes
The logging system has two levels: an event type, which describes the general category and can be vie...
Definition: DefaultSettings.php:7596
RecentChange\SRC_EDIT
const SRC_EDIT
Definition: RecentChange.php:71
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
DB_MASTER
const DB_MASTER
Definition: defines.php:26
RecentChange\SRC_NEW
const SRC_NEW
Definition: RecentChange.php:72
$wgFeedClasses
$wgFeedClasses
Available feeds objects.
Definition: DefaultSettings.php:6898
RebuildRecentchanges
Maintenance script that rebuilds recent changes from scratch.
Definition: rebuildrecentchanges.php:36
RebuildRecentchanges\rebuildRecentChangesTablePass2
rebuildRecentChangesTablePass2(ILBFactory $lbFactory)
Rebuild pass 2: Enhance entries for page revisions with references to the previous revision (rc_last_...
Definition: rebuildrecentchanges.php:181
$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:7620
$wgRCMaxAge
$wgRCMaxAge
Recentchanges items are periodically purged; entries older than this many seconds will go.
Definition: DefaultSettings.php:6680
RC_NEW
const RC_NEW
Definition: Defines.php:144
User\getQueryInfo
static getQueryInfo()
Return the tables, fields, and join conditions to be selected to create a new user object.
Definition: User.php:5594
$wgMiserMode
$wgMiserMode
Disable database-intensive features.
Definition: DefaultSettings.php:2170
Maintenance\getOption
getOption( $name, $default=null)
Get an option, or return the default.
Definition: Maintenance.php:254
RebuildRecentchanges\$cutoffFrom
int $cutoffFrom
UNIX timestamp.
Definition: rebuildrecentchanges.php:38
Maintenance\getBatchSize
getBatchSize()
Returns batch size.
Definition: Maintenance.php:321
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
Maintenance\getDB
getDB( $db, $groups=[], $wiki=false)
Returns a database to be used by current maintenance script.
Definition: Maintenance.php:1309
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:460
Maintenance\output
output( $out, $channel=null)
Throw some output to the user.
Definition: Maintenance.php:388
class
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
Definition: maintenance.txt:52
MediaWikiServices
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
Definition: injection.txt:23
Maintenance\hasOption
hasOption( $name)
Checks to see if a particular param exists.
Definition: Maintenance.php:240
CommentStore\getStore
static getStore()
Definition: CommentStore.php:130
RebuildRecentchanges\__construct
__construct()
Default constructor.
Definition: rebuildrecentchanges.php:42
RebuildRecentchanges\purgeFeeds
purgeFeeds()
Purge cached feeds in $wanCache.
Definition: rebuildrecentchanges.php:507
Maintenance\setBatchSize
setBatchSize( $s=0)
Set the batch size.
Definition: Maintenance.php:329
User\getGroupsWithPermission
static getGroupsWithPermission( $role)
Get all the groups who have a given permission.
Definition: User.php:4904
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:84