MediaWiki REL1_35
HtmlFileCacheUpdate.php
Go to the documentation of this file.
1<?php
21use Wikimedia\Assert\Assert;
22
31 private $prefixedDbKeys = [];
32
36 public function __construct( array $prefixedDbKeys ) {
37 $this->prefixedDbKeys = $prefixedDbKeys;
38 }
39
40 public function merge( MergeableUpdate $update ) {
42 Assert::parameterType( __CLASS__, $update, '$update' );
43 '@phan-var self $update';
44
45 $this->prefixedDbKeys = array_merge( $this->prefixedDbKeys, $update->prefixedDbKeys );
46 }
47
52 public static function newFromTitles( $titles ) {
53 $prefixedDbKeys = [];
54 foreach ( $titles as $title ) {
55 $prefixedDbKeys[] = $title->getPrefixedDBkey();
56 }
57
58 return new self( $prefixedDbKeys );
59 }
60
61 public function doUpdate() {
62 foreach ( array_unique( $this->prefixedDbKeys ) as $prefixedDbKey ) {
63 HTMLFileCache::clearFileCache( $prefixedDbKey );
64 }
65 }
66}
static clearFileCache( $title)
Clear the file caches for a page for all actions.
HTMLFileCache purge update for a set of titles.
static newFromTitles( $titles)
merge(MergeableUpdate $update)
Merge this update with $update.
string[] $prefixedDbKeys
List of page prefixed DB keys.
doUpdate()
Perform the actual work.
__construct(array $prefixedDbKeys)
Interface that deferrable updates should implement.
Interface that deferrable updates can implement to signal that updates can be combined.