38 private $htmlCacheUpdater;
68 parent::__construct( $context,
$page,
$ids, $lbFactory );
69 $this->htmlCacheUpdater = $htmlCacheUpdater;
70 $this->repoGroup = $repoGroup;
78 return 'oi_archive_name';
82 return 'deleterevision';
86 return File::DELETED_FILE;
95 foreach ( $this->ids as $timestamp ) {
96 $archiveNames[] = $timestamp .
'!' . $this->page->getDBkey();
99 $queryBuilder = FileSelectQueryBuilder::newForOldFile( $db );
101 ->where( [
'oi_name' => $this->page->getDBkey(),
'oi_archive_name' => $archiveNames ] )
102 ->orderBy(
'oi_timestamp', SelectQueryBuilder::SORT_DESC );
103 return $queryBuilder->caller( __METHOD__ )->fetchResultSet();
111 $this->deleteBatch = [];
112 $this->storeBatch = [];
113 $this->cleanupBatch = [];
117 $status = Status::newGood();
118 $repo = $this->repoGroup->getLocalRepo();
119 if ( $this->storeBatch ) {
122 if ( !$status->isOK() ) {
125 if ( $this->deleteBatch ) {
126 $status->merge( $repo->deleteBatch( $this->deleteBatch ) );
128 if ( !$status->isOK() ) {
133 if ( $this->cleanupBatch ) {
134 $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();
Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.
Prioritized list of file repositories.
Item class for an oldimage table row.
List for oldimage table items.
__construct(IContextSource $context, PageIdentity $page, array $ids, LBFactory $lbFactory, HtmlCacheUpdater $htmlCacheUpdater, RepoGroup $repoGroup)
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.
Interface for objects which can provide a MediaWiki context on request.
Interface for objects (potentially) representing an editable wiki page.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.