MediaWiki  1.28.0
CdnCacheUpdate Class Reference

Handles purging appropriate CDN URLs given a title (or titles) More...

Inheritance diagram for CdnCacheUpdate:
Collaboration diagram for CdnCacheUpdate:

Public Member Functions

 __construct (array $urlArr)
 
 doUpdate ()
 Purges the list of URLs passed to the constructor. More...
 
 merge (MergeableUpdate $update)
 Merge this update with $update. More...
 

Static Public Member Functions

static expand ($url)
 Expand local URLs to fully-qualified URLs using the internal protocol and host defined in $wgInternalServer. More...
 
static newFromTitles ($titles, $urlArr=[])
 Create an update object from an array of Title objects, or a TitleArray object. More...
 
static newSimplePurge (Title $title)
 
static purge (array $urlArr)
 Purges a list of CDN nodes defined in $wgSquidServers. More...
 

Protected Attributes

string[] $urls = []
 Collection of URLs to purge. More...
 

Static Private Member Functions

static getRuleForURL ($url, $rules)
 Find the HTCP routing rule to use for a given URL. More...
 
static HTCPPurge (array $urlArr)
 Send Hyper Text Caching Protocol (HTCP) CLR requests. More...
 

Detailed Description

Handles purging appropriate CDN URLs given a title (or titles)

Definition at line 31 of file CdnCacheUpdate.php.

Constructor & Destructor Documentation

CdnCacheUpdate::__construct ( array  $urlArr)
Parameters
string[]$urlArr Collection of URLs to purge

Definition at line 38 of file CdnCacheUpdate.php.

Member Function Documentation

CdnCacheUpdate::doUpdate ( )

Purges the list of URLs passed to the constructor.

Implements DeferrableUpdate.

Definition at line 77 of file CdnCacheUpdate.php.

References $wgCdnReboundPurgeDelay, global, Title\makeTitle(), NS_SPECIAL, and JobQueueGroup\singleton().

static CdnCacheUpdate::expand (   $url)
static

Expand local URLs to fully-qualified URLs using the internal protocol and host defined in $wgInternalServer.

Input that's already fully- qualified will be passed through unchanged.

This is used to generate purge URLs that may be either local to the main wiki or include a non-native host, such as images hosted on a second internal server.

Client functions should not need to call this.

Parameters
string$url
Returns
string

Definition at line 269 of file CdnCacheUpdate.php.

References PROTO_INTERNAL, and wfExpandUrl().

Referenced by SquidPurgeClient\queuePurge().

static CdnCacheUpdate::getRuleForURL (   $url,
  $rules 
)
staticprivate

Find the HTCP routing rule to use for a given URL.

Parameters
string$urlURL to match
array$rulesArray of rules, see $wgHTCPRouting for format and behavior
Returns
mixed Element of $rules that matched, or false if nothing matched

Definition at line 279 of file CdnCacheUpdate.php.

References as.

static CdnCacheUpdate::HTCPPurge ( array  $urlArr)
staticprivate

Send Hyper Text Caching Protocol (HTCP) CLR requests.

Exceptions
MWException
Parameters
string[]$urlArr Collection of URLs to purge

Definition at line 168 of file CdnCacheUpdate.php.

References $wgHTCPMulticastTTL, $wgHTCPRouting, as, global, UIDGenerator\newSequentialPerNodeIDs(), UIDGenerator\QUICK_VOLATILE, and wfDebugLog().

CdnCacheUpdate::merge ( MergeableUpdate  $update)

Merge this update with $update.

Parameters
MergeableUpdate$updateUpdate of the same class type

Implements MergeableUpdate.

Definition at line 42 of file CdnCacheUpdate.php.

static CdnCacheUpdate::newFromTitles (   $titles,
  $urlArr = [] 
)
static

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

Parameters
Traversable | array$titles
string[]$urlArr
Returns
CdnCacheUpdate

Definition at line 56 of file CdnCacheUpdate.php.

References $title, $titles, and as.

Referenced by HTMLCacheUpdateJob\invalidateTitles().

static CdnCacheUpdate::newSimplePurge ( Title  $title)
static
Parameters
Title$title
Returns
CdnCacheUpdate
Deprecated:
since 1.27

Definition at line 70 of file CdnCacheUpdate.php.

References Title\getCdnUrls().

static CdnCacheUpdate::purge ( array  $urlArr)
static

Purges a list of CDN nodes defined in $wgSquidServers.

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

Parameters
string[]$urlArr List of full URLs to purge

Definition at line 100 of file CdnCacheUpdate.php.

References $wgHTCPRouting, $wgSquidServers, as, global, use, and wfDebugLog().

Referenced by BenchmarkPurge\benchSquid(), and CdnPurgeJob\run().

Member Data Documentation

string [] CdnCacheUpdate::$urls = []
protected

Collection of URLs to purge.

Definition at line 33 of file CdnCacheUpdate.php.


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