MediaWiki master
CdnPurgeJob.php
Go to the documentation of this file.
1<?php
22
26
33class CdnPurgeJob extends Job implements GenericParameterJob {
34 public function __construct( array $params ) {
35 parent::__construct( 'cdnPurge', $params );
36 $this->removeDuplicates = false; // delay semantics are critical
37 }
38
39 public function run() {
40 // Use purge() directly to avoid infinite recursion
41 CdnCacheUpdate::purge( $this->params['urls'] );
42
43 return true;
44 }
45}
46
48class_alias( CdnPurgeJob::class, 'CdnPurgeJob' );
Handles purging the appropriate CDN objects given a list of URLs or Title instances.
Describe and execute a background job.
Definition Job.php:41
array $params
Array of job parameters.
Definition Job.php:46
Job to purge a set of URLs from CDN.
Interface for generic jobs only uses the parameters field and are JSON serializable.