}
public function merge( MergeableUpdate $update ) {
- /** @var CdnCacheUpdate $update */
+ /** @var self $update */
Assert::parameterType( __CLASS__, $update, '$update' );
+ '@phan-var self $update';
$this->urls = array_merge( $this->urls, $update->urls );
}
$urlArr = array_merge( $urlArr, $title->getCdnUrls() );
}
- return new self( $urlArr );
+ return new CdnCacheUpdate( $urlArr );
}
+ /**
+ * Purges the list of URLs passed to the constructor.
+ */
public function doUpdate() {
global $wgCdnReboundPurgeDelay;
foreach ( $chunks as $chunk ) {
$client = new SquidPurgeClient( $server );
foreach ( $chunk as $url ) {
- $client->queuePurge( $url );
+ $client->queuePurge( self::expand( $url ) );
}
$pool->addClient( $client );
}
* @param string $url
* @return string
*/
- public static function expand( $url ) {
+ private static function expand( $url ) {
return wfExpandUrl( $url, PROTO_INTERNAL );
}