Reset Title cache when importing titles.
[lhc/web/wiklou.git] / includes / Title.php
index 509fc27..d5eff46 100644 (file)
@@ -265,6 +265,7 @@ class Title {
                if ( is_object( $text ) ) {
                        throw new InvalidArgumentException( '$text must be a string.' );
                } elseif ( !is_string( $text ) ) {
+                       wfDebugLog( 'T76305', wfGetAllCallers( 5 ) );
                        wfWarn( __METHOD__ . ': $text must be a string. This will throw an InvalidArgumentException in future.', 2 );
                }
 
@@ -3308,6 +3309,14 @@ class Title {
                $this->mIsBigDeletion = null;
        }
 
+       public static function clearCaches() {
+               $linkCache = LinkCache::singleton();
+               $linkCache->clear();
+
+               $titleCache = self::getTitleCache();
+               $titleCache->clear();
+       }
+
        /**
         * Capitalize a text string for a title if it belongs to a namespace that capitalizes
         *