tableName calls moved inside fieldInfoMulti and removed call that existed only for...
[lhc/web/wiklou.git] / maintenance / deleteOldRevisions.php
index 917f1ba..1f4dc4c 100644 (file)
@@ -29,13 +29,11 @@ class DeleteOldRevisions extends Maintenance {
                parent::__construct();
                $this->mDescription = "Delete old (non-current) revisions from the database";
                $this->addOption( 'delete', 'Actually perform the deletion' );
+               $this->addOption( 'page_id', 'List of page ids to work on', false );
        }
        
        public function execute() {
                $this->output( "Delete old revisions\n\n" );
-               if( count( $this->mArgs ) < 1 ) {
-                       $this->error( "Must pass at least 1 page_id", true );
-               }
                $this->doDelete( $this->hasOption( 'delete' ), $this->mArgs );
        }
        
@@ -68,6 +66,7 @@ class DeleteOldRevisions extends Maintenance {
                $this->output( "done.\n" );
        
                # Get all revisions that aren't in this set
+               $old = array();
                $this->output( "Searching for inactive revisions..." );
                $set = implode( ', ', $cur );
                $res = $dbw->query( "SELECT rev_id FROM $tbl_rev WHERE rev_id NOT IN ( $set ){$revPageClause}" );