+
+ $this->output( "Inserting from page and revision tables...\n" );
+ $inserted = 0;
+ foreach ( $res as $row ) {
+ $dbw->insert(
+ 'recentchanges',
+ [
+ 'rc_timestamp' => $row->rev_timestamp,
+ 'rc_user' => $row->rev_user,
+ 'rc_user_text' => $row->rev_user_text,
+ 'rc_namespace' => $row->page_namespace,
+ 'rc_title' => $row->page_title,
+ 'rc_comment' => $row->rev_comment,
+ 'rc_minor' => $row->rev_minor_edit,
+ 'rc_bot' => 0,
+ 'rc_new' => $row->page_is_new,
+ 'rc_cur_id' => $row->page_id,
+ 'rc_this_oldid' => $row->rev_id,
+ 'rc_last_oldid' => 0, // is this ok?
+ 'rc_type' => $row->page_is_new ? RC_NEW : RC_EDIT,
+ 'rc_source' => $row->page_is_new
+ ? $dbw->addQuotes( RecentChange::SRC_NEW )
+ : $dbw->addQuotes( RecentChange::SRC_EDIT )
+ ,
+ 'rc_deleted' => $row->rev_deleted
+ ],
+ __METHOD__
+ );
+ if ( ( ++$inserted % $this->mBatchSize ) == 0 ) {
+ wfGetLBFactory()->waitForReplication();
+ }
+ }