43 private $htmlCacheUpdater;
73 parent::__construct( $context,
$page,
$ids, $lbFactory );
74 $this->htmlCacheUpdater = $htmlCacheUpdater;
75 $this->repoGroup = $repoGroup;
83 return 'oi_archive_name';
87 return 'deleterevision';
91 return File::DELETED_FILE;
100 foreach ( $this->ids as $timestamp ) {
101 $archiveNames[] = $timestamp .
'!' . $this->page->getDBkey();
104 $queryBuilder = FileSelectQueryBuilder::newForOldFile( $db );
106 ->where( [
'oi_name' => $this->page->getDBkey(),
'oi_archive_name' => $archiveNames ] )
107 ->orderBy(
'oi_timestamp', SelectQueryBuilder::SORT_DESC );
108 return $queryBuilder->caller( __METHOD__ )->fetchResultSet();
116 $this->deleteBatch = [];
117 $this->storeBatch = [];
118 $this->cleanupBatch = [];
122 $status = Status::newGood();
123 $repo = $this->repoGroup->getLocalRepo();
124 if ( $this->storeBatch ) {
125 $status->merge( $repo->storeBatch( $this->storeBatch, FileRepo::OVERWRITE_SAME ) );
127 if ( !$status->isOK() ) {
130 if ( $this->deleteBatch ) {
131 $status->merge( $repo->deleteBatch( $this->deleteBatch ) );
133 if ( !$status->isOK() ) {
138 if ( $this->cleanupBatch ) {
139 $status->merge( $repo->cleanupDeletedBatch( $this->cleanupBatch ) );
146 $file = $this->repoGroup->getLocalRepo()->newFile( $this->page );
148 $file->purgeDescription();
152 foreach ( $this->ids as $timestamp ) {
153 $archiveName = $timestamp .
'!' . $this->page->getDBkey();
154 $file->purgeOldThumbnails( $archiveName );
155 $purgeUrls[] = $file->getArchiveUrl( $archiveName );
158 $this->htmlCacheUpdater->purgeUrls(
160 HTMLCacheUpdater::PURGE_INTENT_TXROUND_REFLECTED
163 return Status::newGood();
Item class for an oldimage table row.
List for oldimage table items.
static getRelationType()
Get the DB field name associated with the ID list.
doPostCommitUpdates(array $visibilityChangeMap)
A hook for setVisibility(): do any necessary updates post-commit.
doPreCommitUpdates()
A hook for setVisibility(): do batch updates pre-commit.
clearFileOps()
Clear any data structures needed for doPreCommitUpdates() and doPostCommitUpdates() STUB.
newItem( $row)
Create an item object from a DB result row.
getType()
Get the internal type name of this list.
static getRevdelConstant()
Get the revision deletion constant for this list type Override this function.
static getRestriction()
Get the user right required for this list type Override this function.
__construct(IContextSource $context, PageIdentity $page, array $ids, LBFactory $lbFactory, HTMLCacheUpdater $htmlCacheUpdater, RepoGroup $repoGroup)
Interface for objects which can provide a MediaWiki context on request.
Interface for objects (potentially) representing an editable wiki page.