ids as $timestamp ) { $archiveNames[] = $timestamp . '!' . $this->title->getDBkey(); } $oiQuery = OldLocalFile::getQueryInfo(); return $db->select( $oiQuery['tables'], $oiQuery['fields'], [ 'oi_name' => $this->title->getDBkey(), 'oi_archive_name' => $archiveNames ], __METHOD__, [ 'ORDER BY' => 'oi_timestamp DESC' ], $oiQuery['joins'] ); } public function newItem( $row ) { return new RevDelFileItem( $this, $row ); } public function clearFileOps() { $this->deleteBatch = []; $this->storeBatch = []; $this->cleanupBatch = []; } 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( array $visibilityChangeMap ) { $file = wfLocalFile( $this->title ); $file->purgeCache(); $file->purgeDescription(); // Purge full images from cache $purgeUrls = []; foreach ( $this->ids as $timestamp ) { $archiveName = $timestamp . '!' . $this->title->getDBkey(); $file->purgeOldThumbnails( $archiveName ); $purgeUrls[] = $file->getArchiveUrl( $archiveName ); } DeferredUpdates::addUpdate( new CdnCacheUpdate( $purgeUrls ), DeferredUpdates::PRESEND ); return Status::newGood(); } public function getSuppressBit() { return File::DELETED_RESTRICTED; } }