From 4e724eb206da9f70c381e5b4fd8d3a773575d2e3 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 8 Nov 2010 11:32:40 +0000 Subject: [PATCH] * (bug 25175) HTML file cache now honor $wgCacheDirectory if $wgFileCacheDirectory is not set This reverts part of r74797 --- RELEASE-NOTES | 2 ++ includes/HTMLFileCache.php | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c50482cc51..ed9d3cbebe 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -405,6 +405,8 @@ LocalSettings.php. The specific bugs are listed below in the general notes. * (bug 25713) SpecialPage::resolveAlias() now normalise spaces to underscores * (bug 25829) Special:Mypage and Special:Mytalk now forward oldid, diff and dir parameters +* (bug 25175) HTML file cache now honor $wgCacheDirectory if + $wgFileCacheDirectory is not set === API changes in 1.17 === * (bug 22738) Allow filtering by action type on query=logevent. diff --git a/includes/HTMLFileCache.php b/includes/HTMLFileCache.php index edae81b6aa..80744f766f 100644 --- a/includes/HTMLFileCache.php +++ b/includes/HTMLFileCache.php @@ -32,7 +32,11 @@ class HTMLFileCache { if( !$this->mFileCache ) { global $wgCacheDirectory, $wgFileCacheDirectory; - if ( !$wgFileCacheDirectory && !$wgCacheDirectory ) { + 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' ); } @@ -45,7 +49,7 @@ class HTMLFileCache { $hash1 = substr( $hash, 0, 1 ); $hash2 = substr( $hash, 0, 2 ); - $this->mFileCache = "{$wgFileCacheDirectory}/{$subdir}{$hash1}/{$hash2}/{$key}.html"; + $this->mFileCache = "{$dir}/{$subdir}{$hash1}/{$hash2}/{$key}.html"; if( $this->useGzip() ) { $this->mFileCache .= '.gz'; -- 2.20.1