MediaWiki  master
CdnPurgeJob.php
Go to the documentation of this file.
1 <?php
30 class CdnPurgeJob extends Job implements GenericParameterJob {
31  public function __construct( array $params ) {
32  parent::__construct( 'cdnPurge', $params );
33  $this->removeDuplicates = false; // delay semantics are critical
34  }
35 
36  public function run() {
37  // Use purge() directly to avoid infinite recursion
38  CdnCacheUpdate::purge( $this->params['urls'] );
39 
40  return true;
41  }
42 }
Job\$params
array $params
Array of job parameters.
Definition: Job.php:37
Job
Class to both describe a background job and handle jobs.
Definition: Job.php:32
CdnPurgeJob\__construct
__construct(array $params)
Definition: CdnPurgeJob.php:31
CdnPurgeJob
Job to purge a set of URLs from CDN.
Definition: CdnPurgeJob.php:30
CdnPurgeJob\run
run()
Run the job.
Definition: CdnPurgeJob.php:36
GenericParameterJob
Interface for generic jobs only uses the parameters field and are JSON serializable.
Definition: GenericParameterJob.php:31
CdnCacheUpdate\purge
static purge(array $urls)
Purges a list of CDN nodes defined in $wgCdnServers.
Definition: CdnCacheUpdate.php:112