From 4302b0419d96b26cef8352b3aa3fe70499a9b8e8 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 11 Dec 2015 16:40:35 -0800 Subject: [PATCH] Rename getSquidURLs() => getCdnUrls() Change-Id: I433acc7990a5fcefd0d2ff5b14ba33dec0424706 --- includes/MediaWiki.php | 4 ++-- includes/Title.php | 11 +++++++++-- includes/actions/RawAction.php | 2 +- includes/deferred/CdnCacheUpdate.php | 4 ++-- includes/page/WikiPage.php | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 409d9e063e..bb0f1e4f41 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -446,9 +446,9 @@ class MediaWiki { # Let CDN cache things if we can purge them. if ( $this->config->get( 'UseSquid' ) && in_array( - // Use PROTO_INTERNAL because that's what getSquidURLs() uses + // Use PROTO_INTERNAL because that's what getCdnUrls() uses wfExpandUrl( $request->getRequestURL(), PROTO_INTERNAL ), - $requestTitle->getSquidURLs() + $requestTitle->getCdnUrls() ) ) { $output->setCdnMaxage( $this->config->get( 'SquidMaxage' ) ); diff --git a/includes/Title.php b/includes/Title.php index e2c2143c4a..5d8b07230b 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3562,7 +3562,7 @@ class Title { * * @return string[] Array of String the URLs */ - public function getSquidURLs() { + public function getCdnUrls() { $urls = array( $this->getInternalURL(), $this->getInternalURL( 'action=history' ) @@ -3587,12 +3587,19 @@ class Title { return $urls; } + /** + * @deprecated since 1.27 use getCdnUrls() + */ + public function getSquidURLs() { + return $this->getCdnUrls(); + } + /** * Purge all applicable CDN URLs */ public function purgeSquid() { DeferredUpdates::addUpdate( - new CdnCacheUpdate( $this->getSquidURLs() ), + new CdnCacheUpdate( $this->getCdnUrls() ), DeferredUpdates::PRESEND ); } diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php index 78197ab699..6de95a09e3 100644 --- a/includes/actions/RawAction.php +++ b/includes/actions/RawAction.php @@ -81,7 +81,7 @@ class RawAction extends FormlessAction { $smaxage = $config->get( 'SquidMaxage' ); } elseif ( $contentType == 'text/css' || $contentType == 'text/javascript' ) { // CSS/JS raw content has its own CDN max age configuration. - // Note: Title::getSquidURLs() includes action=raw for css/js pages, + // Note: Title::getCdnUrls() includes action=raw for css/js pages, // so if using the canonical url, this will get HTCP purges. $smaxage = intval( $config->get( 'ForcedRawSMaxage' ) ); } else { diff --git a/includes/deferred/CdnCacheUpdate.php b/includes/deferred/CdnCacheUpdate.php index 25c27e3fb8..9f7d8caec7 100644 --- a/includes/deferred/CdnCacheUpdate.php +++ b/includes/deferred/CdnCacheUpdate.php @@ -55,7 +55,7 @@ class CdnCacheUpdate implements DeferrableUpdate, MergeableUpdate { public static function newFromTitles( $titles, $urlArr = array() ) { /** @var Title $title */ foreach ( $titles as $title ) { - $urlArr = array_merge( $urlArr, $title->getSquidURLs() ); + $urlArr = array_merge( $urlArr, $title->getCdnUrls() ); } return new CdnCacheUpdate( $urlArr ); @@ -67,7 +67,7 @@ class CdnCacheUpdate implements DeferrableUpdate, MergeableUpdate { * @deprecated 1.27 */ public static function newSimplePurge( Title $title ) { - return new CdnCacheUpdate( $title->getSquidURLs() ); + return new CdnCacheUpdate( $title->getCdnUrls() ); } /** diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index a289382e9d..f290db88ff 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1133,7 +1133,7 @@ class WikiPage implements Page, IDBAccessObject { // Send purge after above page_touched update was committed DeferredUpdates::addUpdate( - new CdnCacheUpdate( $title->getSquidURLs() ), + new CdnCacheUpdate( $title->getCdnUrls() ), DeferredUpdates::PRESEND ); -- 2.20.1