40 private $htmlCacheUpdater;
70 parent::__construct( $context,
$page,
$ids, $lbFactory );
71 $this->htmlCacheUpdater = $htmlCacheUpdater;
72 $this->repoGroup = $repoGroup;
80 return 'oi_archive_name';
84 return 'deleterevision';
88 return File::DELETED_FILE;
97 foreach ( $this->ids as $timestamp ) {
98 $archiveNames[] = $timestamp .
'!' . $this->page->getDBkey();
101 $queryBuilder = FileSelectQueryBuilder::newForOldFile( $db );
103 ->where( [
'oi_name' => $this->page->getDBkey(),
'oi_archive_name' => $archiveNames ] )
104 ->orderBy(
'oi_timestamp', SelectQueryBuilder::SORT_DESC );
105 return $queryBuilder->caller( __METHOD__ )->fetchResultSet();
113 $this->deleteBatch = [];
114 $this->storeBatch = [];
115 $this->cleanupBatch = [];
119 $status = Status::newGood();
120 $repo = $this->repoGroup->getLocalRepo();
121 if ( $this->storeBatch ) {
124 if ( !$status->isOK() ) {
127 if ( $this->deleteBatch ) {
128 $status->merge( $repo->deleteBatch( $this->deleteBatch ) );
130 if ( !$status->isOK() ) {
135 if ( $this->cleanupBatch ) {
136 $status->merge( $repo->cleanupDeletedBatch( $this->cleanupBatch ) );
143 $file = $this->repoGroup->getLocalRepo()->newFile( $this->page );
145 $file->purgeDescription();
149 foreach ( $this->ids as $timestamp ) {
150 $archiveName = $timestamp .
'!' . $this->page->getDBkey();
151 $file->purgeOldThumbnails( $archiveName );
152 $purgeUrls[] = $file->getArchiveUrl( $archiveName );
155 $this->htmlCacheUpdater->purgeUrls(
157 HTMLCacheUpdater::PURGE_INTENT_TXROUND_REFLECTED
160 return Status::newGood();
Prioritized list of file repositories.
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.