MediaWiki
master
HtmlFileCacheUpdate.php
Go to the documentation of this file.
1
<?php
21
use Wikimedia\Assert\Assert;
22
29
class
HtmlFileCacheUpdate
implements
DeferrableUpdate
,
MergeableUpdate
{
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
}
MergeableUpdate
Interface that deferrable updates can implement to signal that updates can be combined.
Definition:
MergeableUpdate.php:21
HTMLFileCache\clearFileCache
static clearFileCache( $title)
Clear the file caches for a page for all actions.
Definition:
HTMLFileCache.php:226
HtmlFileCacheUpdate\__construct
__construct(array $prefixedDbKeys)
Definition:
HtmlFileCacheUpdate.php:36
HtmlFileCacheUpdate\newFromTitles
static newFromTitles( $titles)
Definition:
HtmlFileCacheUpdate.php:52
HtmlFileCacheUpdate
HTMLFileCache purge update for a set of titles.
Definition:
HtmlFileCacheUpdate.php:29
HtmlFileCacheUpdate\doUpdate
doUpdate()
Perform the actual work.
Definition:
HtmlFileCacheUpdate.php:61
$title
$title
Definition:
testCompression.php:38
HtmlFileCacheUpdate\$prefixedDbKeys
string[] $prefixedDbKeys
List of page prefixed DB keys.
Definition:
HtmlFileCacheUpdate.php:31
DeferrableUpdate
Interface that deferrable updates should implement.
Definition:
DeferrableUpdate.php:11
HtmlFileCacheUpdate\merge
merge(MergeableUpdate $update)
Merge this enqueued update with a new MergeableUpdate of the same qualified class name.
Definition:
HtmlFileCacheUpdate.php:40
includes
deferred
HtmlFileCacheUpdate.php
Generated on Fri Jan 22 2021 05:08:26 for MediaWiki by
1.8.19