Merge "Tweak wording for 'passwordreset-emailsentemail', 'passwordreset-emailsentuser...
[lhc/web/wiklou.git] / includes / Title.php
index 4b39efd..35d9c6b 100644 (file)
@@ -768,16 +768,16 @@ class Title {
         * @param string $title The DB key form the title
         * @param string $fragment The link fragment (after the "#")
         * @param string $interwiki The interwiki prefix
-        * @param bool $canoncialNamespace If true, use the canonical name for
+        * @param bool $canonicalNamespace If true, use the canonical name for
         *   $ns instead of the localized version.
         * @return string The prefixed form of the title
         */
        public static function makeName( $ns, $title, $fragment = '', $interwiki = '',
-               $canoncialNamespace = false
+               $canonicalNamespace = false
        ) {
                global $wgContLang;
 
-               if ( $canoncialNamespace ) {
+               if ( $canonicalNamespace ) {
                        $namespace = MWNamespace::getCanonicalName( $ns );
                } else {
                        $namespace = $wgContLang->getNsText( $ns );
@@ -1824,7 +1824,7 @@ class Title {
 
        /**
         * Get the URL form for an internal link.
-        * - Used in various Squid-related code, in case we have a different
+        * - Used in various CDN-related code, in case we have a different
         * internal hostname for the server from the exposed one.
         *
         * This uses $wgInternalServer to qualify the path, or $wgServer
@@ -3557,12 +3557,12 @@ class Title {
        }
 
        /**
-        * Get a list of URLs to purge from the Squid cache when this
+        * Get a list of URLs to purge from the CDN cache when this
         * page changes
         *
         * @return string[] Array of String the URLs
         */
-       public function getSquidURLs() {
+       public function getCdnUrls() {
                $urls = array(
                        $this->getInternalURL(),
                        $this->getInternalURL( 'action=history' )
@@ -3588,15 +3588,20 @@ class Title {
        }
 
        /**
-        * Purge all applicable Squid URLs
+        * @deprecated since 1.27 use getCdnUrls()
+        */
+       public function getSquidURLs() {
+               return $this->getCdnUrls();
+       }
+
+       /**
+        * Purge all applicable CDN URLs
         */
        public function purgeSquid() {
-               global $wgUseSquid;
-               if ( $wgUseSquid ) {
-                       $urls = $this->getSquidURLs();
-                       $u = new SquidUpdate( $urls );
-                       $u->doUpdate();
-               }
+               DeferredUpdates::addUpdate(
+                       new CdnCacheUpdate( $this->getCdnUrls() ),
+                       DeferredUpdates::PRESEND
+               );
        }
 
        /**
@@ -4417,7 +4422,7 @@ class Title {
        }
 
        /**
-        * Update page_touched timestamps and send squid purge messages for
+        * Update page_touched timestamps and send CDN purge messages for
         * pages linking to this title. May be sent to the job queue depending
         * on the number of links. Typically called on create and delete.
         */