Simplified cacheDirectory() in FileCacheBase and HTMLFileCache. It turns out $wgFileC...
authorAaron Schulz <aaron@users.mediawiki.org>
Mon, 3 Oct 2011 06:54:39 +0000 (06:54 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Mon, 3 Oct 2011 06:54:39 +0000 (06:54 +0000)
includes/cache/FileCacheBase.php
includes/cache/HTMLFileCache.php

index e6be049..3ad9b7c 100644 (file)
@@ -28,15 +28,8 @@ abstract class FileCacheBase {
         * @return string
         */
        final protected function baseCacheDirectory() {
-               global $wgCacheDirectory, $wgFileCacheDirectory, $wgFileCacheDepth;
-               if ( $wgFileCacheDirectory ) {
-                       $dir = $wgFileCacheDirectory;
-               } elseif ( $wgCacheDirectory ) {
-                       $dir = $wgCacheDirectory;
-               } else {
-                       throw new MWException( 'Please set $wgCacheDirectory in LocalSettings.php if you wish to use the HTML file cache' );
-               }
-               return $dir;
+               global $wgFileCacheDirectory;
+               return $wgFileCacheDirectory;
        }
 
        /**
index 532850a..c0c4a57 100644 (file)
@@ -35,19 +35,10 @@ class HTMLFileCache extends FileCacheBase {
 
        /**
         * Get the base file cache directory
-        * Note: avoids baseCacheDirectory() for b/c to not skip existing cache
         * @return string
         */
        protected function cacheDirectory() {
-               global $wgCacheDirectory, $wgFileCacheDirectory, $wgFileCacheDepth;
-               if ( $wgFileCacheDirectory ) {
-                       $dir = $wgFileCacheDirectory;
-               } elseif ( $wgCacheDirectory ) {
-                       $dir = "$wgCacheDirectory/html";
-               } else {
-                       throw new MWException( 'Please set $wgCacheDirectory in LocalSettings.php if you wish to use the HTML file cache' );
-               }
-               return $dir;
+               return $this->baseCacheDirectory(); // no subdir for b/c with old cache files
        }
 
        /**