Rename getSquidURLs() => getCdnUrls()
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 12 Dec 2015 00:40:35 +0000 (16:40 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 12 Dec 2015 00:40:35 +0000 (16:40 -0800)
Change-Id: I433acc7990a5fcefd0d2ff5b14ba33dec0424706

includes/MediaWiki.php
includes/Title.php
includes/actions/RawAction.php
includes/deferred/CdnCacheUpdate.php
includes/page/WikiPage.php

index 409d9e0..bb0f1e4 100644 (file)
@@ -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' ) );
index e2c2143..5d8b072 100644 (file)
@@ -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
                );
        }
index 78197ab..6de95a0 100644 (file)
@@ -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 {
index 25c27e3..9f7d8ca 100644 (file)
@@ -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() );
        }
 
        /**
index a289382..f290db8 100644 (file)
@@ -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
                );