Add new recentchanges field rc_source to replace rc_type
[lhc/web/wiklou.git] / maintenance / rebuildrecentchanges.php
index 6609531..315176c 100644 (file)
@@ -23,7 +23,7 @@
  * @todo Document
  */
 
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
 
 /**
  * Maintenance script that rebuilds recent changes from scratch.
@@ -83,6 +83,7 @@ class RebuildRecentchanges extends Maintenance {
                                'rc_this_oldid' => 'rev_id',
                                'rc_last_oldid' => 0, // is this ok?
                                'rc_type'       => $dbw->conditional( 'page_is_new != 0', RC_NEW, RC_EDIT ),
+                               'rc_source'     => $dbw->conditional( 'page_is_new != 0', $dbw->addQuotes( RecentChange::SRC_NEW ), $dbw->addQuotes( RecentChange::SRC_EDIT ) ),
                                'rc_deleted'    => 'rev_deleted'
                        ), array(
                                'rev_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $cutoff ) ),
@@ -99,7 +100,7 @@ class RebuildRecentchanges extends Maintenance {
         */
        private function rebuildRecentChangesTablePass2() {
                $dbw = wfGetDB( DB_MASTER );
-               list ( $recentchanges, $revision ) = $dbw->tableNamesN( 'recentchanges', 'revision' );
+               list( $recentchanges, $revision ) = $dbw->tableNamesN( 'recentchanges', 'revision' );
 
                $this->output( "Updating links and size differences...\n" );
 
@@ -292,4 +293,4 @@ class RebuildRecentchanges extends Maintenance {
 }
 
 $maintClass = "RebuildRecentchanges";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;