}
/**
- * Rebuild pass 1
- * DOCUMENT ME!
+ * Rebuild pass 1: Insert `recentchanges` entries for page revisions.
*/
private function rebuildRecentChangesTablePass1() {
- $dbw = wfGetDB( DB_MASTER );
+ $dbw = $this->getDB( DB_MASTER );
$dbw->delete( 'recentchanges', '*' );
}
/**
- * Rebuild pass 2
- * DOCUMENT ME!
+ * Rebuild pass 2: Enhance entries for page revisions with references to the previous revision
+ * (rc_last_oldid, rc_new etc.) and size differences (rc_old_len, rc_new_len).
*/
private function rebuildRecentChangesTablePass2() {
- $dbw = wfGetDB( DB_MASTER );
+ $dbw = $this->getDB( DB_MASTER );
list( $recentchanges, $revision ) = $dbw->tableNamesN( 'recentchanges', 'revision' );
$this->output( "Updating links and size differences...\n" );
}
/**
- * Rebuild pass 3
- * DOCUMENT ME!
+ * Rebuild pass 3: Insert `recentchanges` entries for action logs.
*/
private function rebuildRecentChangesTablePass3() {
- $dbw = wfGetDB( DB_MASTER );
+ $dbw = $this->getDB( DB_MASTER );
$this->output( "Loading from user, page, and logging tables...\n" );
// Some logs don't go in RC. This should check for that
$basicRCLogs = array_diff( $wgLogTypes, array_keys( $wgLogRestrictions ) );
- // Escape...blah blah
- $selectLogs = array();
- foreach ( $basicRCLogs as $logtype ) {
- $safetype = $dbw->strencode( $logtype );
- $selectLogs[] = "'$safetype'";
- }
-
$cutoff = time() - $wgRCMaxAge;
list( $logging, $page ) = $dbw->tableNamesN( 'logging', 'page' );
$dbw->insertSelect(
array(
'log_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $cutoff ) ),
'log_user=user_id',
- 'log_type IN(' . implode( ',', $selectLogs ) . ')'
+ 'log_type' => $basicRCLogs,
),
__METHOD__,
array(), // INSERT options
}
/**
- * Rebuild pass 4
- * DOCUMENT ME!
+ * Rebuild pass 4: Mark bot and autopatrolled entries.
*/
private function rebuildRecentChangesTablePass4() {
global $wgUseRCPatrol;
- $dbw = wfGetDB( DB_MASTER );
+ $dbw = $this->getDB( DB_MASTER );
list( $recentchanges, $usergroups, $user ) =
$dbw->tableNamesN( 'recentchanges', 'user_groups', 'user' );