From: Alexandre Emsenhuber Date: Mon, 8 Nov 2010 11:32:40 +0000 (+0000) Subject: * (bug 25175) HTML file cache now honor $wgCacheDirectory if $wgFileCacheDirectory... X-Git-Tag: 1.31.0-rc.0~33997 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=4e724eb206da9f70c381e5b4fd8d3a773575d2e3;p=lhc%2Fweb%2Fwiklou.git * (bug 25175) HTML file cache now honor $wgCacheDirectory if $wgFileCacheDirectory is not set This reverts part of r74797 --- 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';