duh
[lhc/web/wiklou.git] / maintenance / rebuildrecentchanges.inc
index 26f334e..d34c6e3 100644 (file)
@@ -3,15 +3,14 @@
  * Rebuild recent changes table.
  *
  * @todo document
- * @package MediaWiki
- * @subpackage Maintenance
+ * @addtogroup Maintenance
  */
 
 /** */
 function rebuildRecentChangesTablePass1()
 {
        $fname = 'rebuildRecentChangesTablePass1';
-       $dbw =& wfGetDB( DB_MASTER );
+       $dbw = wfGetDB( DB_MASTER );
        extract( $dbw->tableNames( 'recentchanges', 'cur', 'old' ) );
 
        $dbw->delete( 'recentchanges', '*' );
@@ -37,19 +36,18 @@ function rebuildRecentChangesTablePass1()
                        'rc_last_oldid' => 0, // is this ok?
                        'rc_type'       => $dbw->conditional( 'page_is_new != 0', RC_NEW, RC_EDIT ),
                ), array(
-                       'rev_timestamp > ' . $dbw->timestamp( $cutoff ),
+                       'rev_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $cutoff ) ),
                        'rev_page=page_id'
-               ), $fname, array( 'ORDER BY' => 'rev_timestamp', 'LIMIT' => 5000 )
+               ), $fname,
+               array(), // INSERT options
+               array( 'ORDER BY' => 'rev_timestamp', 'LIMIT' => 5000 ) // SELECT options
        );
 }
 
 function rebuildRecentChangesTablePass2()
 {
-       $dbw =& wfGetDB( DB_MASTER );
-       extract( $dbw->tableNames( 'recentchanges', 'revision' ) );
-
-       $ns = $id = $count = 0;
-       $title = $ct =  "";
+       $dbw = wfGetDB( DB_MASTER );
+       list ($recentchanges, $revision) = $dbw->tableNamesN( 'recentchanges', 'revision' );
 
        print( "Updating links...\n" );