MediaWiki REL1_39
CdnCacheUpdate Class Reference

Handles purging the appropriate CDN objects given a list of URLs or Title instances. More...

Inheritance diagram for CdnCacheUpdate:
Collaboration diagram for CdnCacheUpdate:

Public Member Functions

 __construct (array $targets, array $options=[])
 
 doUpdate ()
 Perform the actual work.
 
 getUrls ()
 
 merge (MergeableUpdate $update)
 Merge this enqueued update with a new MergeableUpdate of the same qualified class name.
 

Static Public Member Functions

static newFromTitles ( $pages, $urls=[])
 Create an update object from an array of Title objects, or a TitleArray object.
 
static purge (array $urls)
 Purges a list of CDN nodes defined in $wgCdnServers.
 

Detailed Description

Handles purging the appropriate CDN objects given a list of URLs or Title instances.

Definition at line 31 of file CdnCacheUpdate.php.

Constructor & Destructor Documentation

◆ __construct()

CdnCacheUpdate::__construct ( array $targets,
array $options = [] )
Parameters
string[] | PageReference[]$targetsCollection of URLs/titles to be purged from CDN
array$optionsOptions map. Supports:
  • reboundDelay: how many seconds after the first purge to send a rebound purge. No rebound purge will be sent if this is not positive. [Default: 0]

Definition at line 46 of file CdnCacheUpdate.php.

Member Function Documentation

◆ doUpdate()

CdnCacheUpdate::doUpdate ( )

Perform the actual work.

Implements DeferrableUpdate.

Definition at line 84 of file CdnCacheUpdate.php.

References purge().

◆ getUrls()

CdnCacheUpdate::getUrls ( )
Returns
string[] List of URLs

Definition at line 159 of file CdnCacheUpdate.php.

◆ merge()

CdnCacheUpdate::merge ( MergeableUpdate $update)

Merge this enqueued update with a new MergeableUpdate of the same qualified class name.

Parameters
MergeableUpdate$updateThe new update (having the same class)

Implements MergeableUpdate.

Definition at line 61 of file CdnCacheUpdate.php.

◆ newFromTitles()

static CdnCacheUpdate::newFromTitles ( $pages,
$urls = [] )
static

Create an update object from an array of Title objects, or a TitleArray object.

Parameters
PageReference[]$pages
string[]$urls
Returns
CdnCacheUpdate
Deprecated
Since 1.35 Use HtmlCacheUpdater instead. Hard deprecated since 1.39.

Definition at line 79 of file CdnCacheUpdate.php.

References wfDeprecated().

◆ purge()

static CdnCacheUpdate::purge ( array $urls)
static

Purges a list of CDN nodes defined in $wgCdnServers.

$urlArr should contain the full URLs to purge as values (example: $urlArr[] = 'http://my.host/something')

Parameters
string[]$urlsList of full URLs to purge

Definition at line 117 of file CdnCacheUpdate.php.

References wfDebugLog().

Referenced by doUpdate(), and CdnPurgeJob\run().


The documentation for this class was generated from the following file: