class DeleteArchivedFiles extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Deletes all archived images.";
+ $this->addDescription( 'Deletes all archived images.' );
$this->addOption( 'delete', 'Perform the deletion' );
$this->addOption( 'force', 'Force deletion of rows from filearchive' );
}
# Data should come off the master, wrapped in a transaction
$dbw = $this->getDB( DB_MASTER );
- $dbw->begin( __METHOD__ );
+ $this->beginTransaction( $dbw, __METHOD__ );
$repo = RepoGroup::singleton()->getLocalRepo();
# Get "active" revisions from the filearchive table
$dbw->delete( 'filearchive', array( 'fa_id' => $id ), __METHOD__ );
}
- $dbw->commit( __METHOD__ );
+ $this->commitTransaction( $dbw, __METHOD__ );
$this->output( "Done! [$count file(s)]\n" );
}
}