Merge "DefaultPreferencesFactory: Remove fallback for null PermissionManager"
[lhc/web/wiklou.git] / includes / cache / HTMLFileCache.php
index 6d0b87e..ab78ee4 100644 (file)
@@ -94,10 +94,6 @@ class HTMLFileCache extends FileCacheBase {
                $config = MediaWikiServices::getInstance()->getMainConfig();
 
                if ( !$config->get( 'UseFileCache' ) && $mode !== self::MODE_REBUILD ) {
-                       return false;
-               } elseif ( $config->get( 'DebugToolbar' ) ) {
-                       wfDebug( "HTML file cache skipped. \$wgDebugToolbar on\n" );
-
                        return false;
                }
 
@@ -219,33 +215,21 @@ class HTMLFileCache extends FileCacheBase {
                return $text;
        }
 
-       /**
-        * @param string[] $prefixedDbKeys List of prefixed DB keys for pages to purge
-        * @since 1.34
-        */
-       public static function purge( array $prefixedDbKeys ) {
-               foreach ( $prefixedDbKeys as $prefixedDbKey ) {
-                       foreach ( self::cacheablePageActions() as $type ) {
-                               $fc = new self( $prefixedDbKey, $type );
-                               $fc->clearCache();
-                       }
-               }
-       }
-
        /**
         * Clear the file caches for a page for all actions
-        * @param Traversable|Title[]|Title $titles
+        * @param Title $title
         * @return bool Whether $wgUseFileCache is enabled
         */
-       public static function clearFileCache( $titles ) {
+       public static function clearFileCache( Title $title ) {
                $config = MediaWikiServices::getInstance()->getMainConfig();
+
                if ( !$config->get( 'UseFileCache' ) ) {
                        return false;
                }
 
-               $titleIterator = ( $titles instanceof Title ) ? [ $titles ] : $titles;
-               foreach ( $titleIterator as $title ) {
-                       self::purge( [ $title->getPrefixedDBkey() ] );
+               foreach ( self::cacheablePageActions() as $type ) {
+                       $fc = new self( $title, $type );
+                       $fc->clearCache();
                }
 
                return true;