31 private $htmlCacheUpdater;
61 parent::__construct( $context,
$page,
$ids, $lbFactory );
62 $this->htmlCacheUpdater = $htmlCacheUpdater;
63 $this->repoGroup = $repoGroup;
73 return 'oi_archive_name';
78 return 'deleterevision';
83 return File::DELETED_FILE;
92 foreach ( $this->ids as $timestamp ) {
93 $archiveNames[] = $timestamp .
'!' . $this->page->getDBkey();
96 $queryBuilder = FileSelectQueryBuilder::newForOldFile( $db );
98 ->where( [
'oi_name' => $this->page->getDBkey(),
'oi_archive_name' => $archiveNames ] )
99 ->orderBy(
'oi_timestamp', SelectQueryBuilder::SORT_DESC );
100 return $queryBuilder->caller( __METHOD__ )->fetchResultSet();
109 $this->deleteBatch = [];
110 $this->storeBatch = [];
111 $this->cleanupBatch = [];
116 $status = Status::newGood();
117 $repo = $this->repoGroup->getLocalRepo();
118 if ( $this->storeBatch ) {
119 $status->merge( $repo->storeBatch( $this->storeBatch, FileRepo::OVERWRITE_SAME ) );
121 if ( !$status->isOK() ) {
124 if ( $this->deleteBatch ) {
125 $status->merge( $repo->deleteBatch( $this->deleteBatch ) );
127 if ( !$status->isOK() ) {
132 if ( $this->cleanupBatch ) {
133 $status->merge( $repo->cleanupDeletedBatch( $this->cleanupBatch ) );
141 $file = $this->repoGroup->getLocalRepo()->newFile( $this->page );
143 $file->purgeDescription();
147 foreach ( $this->ids as $timestamp ) {
148 $archiveName = $timestamp .
'!' . $this->page->getDBkey();
149 $file->purgeOldThumbnails( $archiveName );
150 $purgeUrls[] = $file->getArchiveUrl( $archiveName );
153 $this->htmlCacheUpdater->purgeUrls(
155 HTMLCacheUpdater::PURGE_INTENT_TXROUND_REFLECTED
158 return Status::newGood();
164class_alias( RevDelFileList::class,
'RevDelFileList' );
Interface for objects which can provide a MediaWiki context on request.
Interface for objects (potentially) representing an editable wiki page.