MediaWiki master
HtmlFileCacheUpdate.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\Deferred;
8
12use Wikimedia\Assert\Assert;
13
22 private $pages;
23
27 private function __construct( array $pages ) {
28 $this->pages = $pages;
29 }
30
31 public function merge( MergeableUpdate $update ) {
33 Assert::parameterType( __CLASS__, $update, '$update' );
34 '@phan-var self $update';
35
36 $this->pages = array_merge( $this->pages, $update->pages );
37 }
38
45 public static function newFromPages( $pages ) {
46 $pagesByKey = [];
47 foreach ( $pages as $pg ) {
49 $pagesByKey[$key] = $pg;
50 }
51
52 return new self( $pagesByKey );
53 }
54
55 public function doUpdate() {
56 foreach ( $this->pages as $pg ) {
57 HTMLFileCache::clearFileCache( $pg );
58 }
59 }
60}
61
63class_alias( HtmlFileCacheUpdate::class, 'HtmlFileCacheUpdate' );
Page view caching in the file system.
HTMLFileCache purge update for a set of titles.
merge(MergeableUpdate $update)
Merge this enqueued update with a new MergeableUpdate of the same qualified class name.
Helper class for mapping page value objects to a string key.
static getKeyForPage( $page)
Returns a stable key for identifying the given page in a cache.
Interface that deferrable updates should implement.
Interface that deferrable updates can implement to signal that updates can be combined.
Interface for objects (potentially) representing an editable wiki page.