From 2adff7579d43b053b190635bd3fb51943a2a3399 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 11 Sep 2019 15:00:13 -0700 Subject: [PATCH] Cleanup field visibility and comments in CdnCacheUpdate and HTMLCacheUpdate Change-Id: Ifbdc3e845aee9c6785c7813f6c955da4bfbe2bc8 --- includes/deferred/CdnCacheUpdate.php | 9 ++++----- includes/deferred/HTMLCacheUpdate.php | 15 +++++++-------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/includes/deferred/CdnCacheUpdate.php b/includes/deferred/CdnCacheUpdate.php index ddffaa396b..70447489b7 100644 --- a/includes/deferred/CdnCacheUpdate.php +++ b/includes/deferred/CdnCacheUpdate.php @@ -24,12 +24,12 @@ use Wikimedia\Assert\Assert; use MediaWiki\MediaWikiServices; /** - * Handles purging appropriate CDN URLs given a title (or titles) + * Handles purging the appropriate CDN objects given a list of URLs or Title instances * @ingroup Cache */ class CdnCacheUpdate implements DeferrableUpdate, MergeableUpdate { /** @var string[] Collection of URLs to purge */ - protected $urls = []; + private $urls = []; /** * @param string[] $urlArr Collection of URLs to purge @@ -99,10 +99,9 @@ class CdnCacheUpdate implements DeferrableUpdate, MergeableUpdate { wfDebugLog( 'squid', __METHOD__ . ': ' . implode( ' ', $urlArr ) ); // Reliably broadcast the purge to all edge nodes - $relayer = MediaWikiServices::getInstance()->getEventRelayerGroup() - ->getRelayer( 'cdn-url-purges' ); $ts = microtime( true ); - $relayer->notifyMulti( + $relayerGroup = MediaWikiServices::getInstance()->getEventRelayerGroup(); + $relayerGroup->getRelayer( 'cdn-url-purges' )->notifyMulti( 'cdn-url-purges', array_map( function ( $url ) use ( $ts ) { diff --git a/includes/deferred/HTMLCacheUpdate.php b/includes/deferred/HTMLCacheUpdate.php index 29846bfb77..9e45241841 100644 --- a/includes/deferred/HTMLCacheUpdate.php +++ b/includes/deferred/HTMLCacheUpdate.php @@ -22,16 +22,15 @@ */ /** - * Class to invalidate the HTML cache of all the pages linking to a given title. + * Class to invalidate the HTML/file cache of all the pages linking to a given title * * @ingroup Cache */ class HTMLCacheUpdate extends DataUpdate { /** @var Title */ - public $mTitle; - + private $title; /** @var string */ - public $mTable; + private $table; /** * @param Title $titleTo @@ -42,16 +41,16 @@ class HTMLCacheUpdate extends DataUpdate { function __construct( Title $titleTo, $table, $causeAction = 'unknown', $causeAgent = 'unknown' ) { - $this->mTitle = $titleTo; - $this->mTable = $table; + $this->title = $titleTo; + $this->table = $table; $this->causeAction = $causeAction; $this->causeAgent = $causeAgent; } public function doUpdate() { $job = HTMLCacheUpdateJob::newForBacklinks( - $this->mTitle, - $this->mTable, + $this->title, + $this->table, [ 'causeAction' => $this->getCauseAction(), 'causeAgent' => $this->getCauseAgent() ] ); -- 2.20.1