Simplified cacheDirectory() in FileCacheBase and HTMLFileCache. It turns out $wgFileCacheDirectory is always set in setup.php already.
This commit is contained in:
parent
2bb5bec447
commit
119ee2a872
2 changed files with 3 additions and 19 deletions
11
includes/cache/FileCacheBase.php
vendored
11
includes/cache/FileCacheBase.php
vendored
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
11
includes/cache/HTMLFileCache.php
vendored
11
includes/cache/HTMLFileCache.php
vendored
|
|
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue