ids as $timestamp ) { $archiveNames[] = $timestamp . '!' . $this->title->getDBkey(); } return $db->select( 'oldimage', OldLocalFile::selectFields(), array( 'oi_name' => $this->title->getDBkey(), 'oi_archive_name' => $archiveNames ), __METHOD__, array( 'ORDER BY' => 'oi_timestamp DESC' ) ); } public function newItem( $row ) { return new RevDelFileItem( $this, $row ); } public function clearFileOps() { $this->deleteBatch = array(); $this->storeBatch = array(); $this->cleanupBatch = array(); } public function doPreCommitUpdates() { $status = Status::newGood(); $repo = RepoGroup::singleton()->getLocalRepo(); if ( $this->storeBatch ) { $status->merge( $repo->storeBatch( $this->storeBatch, FileRepo::OVERWRITE_SAME ) ); } if ( !$status->isOK() ) { return $status; } if ( $this->deleteBatch ) { $status->merge( $repo->deleteBatch( $this->deleteBatch ) ); } if ( !$status->isOK() ) { // Running cleanupDeletedBatch() after a failed storeBatch() with the DB already // modified (but destined for rollback) causes data loss return $status; } if ( $this->cleanupBatch ) { $status->merge( $repo->cleanupDeletedBatch( $this->cleanupBatch ) ); } return $status; } public function doPostCommitUpdates() { $file = wfLocalFile( $this->title ); $file->purgeCache(); $file->purgeDescription(); $purgeUrls = array(); foreach ( $this->ids as $timestamp ) { $archiveName = $timestamp . '!' . $this->title->getDBkey(); $file->purgeOldThumbnails( $archiveName ); $purgeUrls[] = $file->getArchiveUrl( $archiveName ); } if ( $this->getConfig()->get( 'UseSquid' ) ) { // purge full images from cache SquidUpdate::purge( $purgeUrls ); } return Status::newGood(); } public function getSuppressBit() { return File::DELETED_RESTRICTED; } }