Simplified cacheDirectory() in FileCacheBase and HTMLFileCache. It turns out $wgFileCacheDirectory is always set in setup.php already.

This commit is contained in:
Aaron Schulz 2011-10-03 06:54:39 +00:00
parent 2bb5bec447
commit 119ee2a872
2 changed files with 3 additions and 19 deletions

View 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;
}
/**

View 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
}
/**