From: Chad Horohoe Date: Thu, 3 Jul 2008 18:37:31 +0000 (+0000) Subject: Don't use $wgTranscludeCacheExpiry, as it's not designed for this. Make new configura... X-Git-Tag: 1.31.0-rc.0~46774 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=21a56a078251cd7305daf7bce1cef540e8c220f0;p=lhc%2Fweb%2Fwiklou.git Don't use $wgTranscludeCacheExpiry, as it's not designed for this. Make new configuration setting for $wgForeignFileRepos instead called 'localCacheExpiry'. --- diff --git a/includes/filerepo/File.php b/includes/filerepo/File.php index 169ae86884..07a77011fb 100644 --- a/includes/filerepo/File.php +++ b/includes/filerepo/File.php @@ -1080,7 +1080,7 @@ abstract class File { } wfDebug( "Fetching shared description from $renderUrl\n" ); $res = Http::get( $renderUrl ); - if ( $res && $this->repo->useLocalCache ) $wgMemc->set( $key, $res, time() + $wgTranscludeCacheExpiry ); + if ( $res && $this->repo->useLocalCache ) $wgMemc->set( $key, $res, $this->repo->localCacheExpiry ); return $res; } else { return false; diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index ca79685b2d..b6318d612a 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -30,7 +30,8 @@ abstract class FileRepo { // Optional settings $this->initialCapital = true; // by default foreach ( array( 'descBaseUrl', 'scriptDirUrl', 'articleUrl', 'fetchDescription', - 'thumbScriptUrl', 'initialCapital', 'pathDisclosureProtection', 'useLocalCache' ) as $var ) + 'thumbScriptUrl', 'initialCapital', 'pathDisclosureProtection', + 'useLocalCache', 'localCacheExpiry' ) as $var ) { if ( isset( $info[$var] ) ) { $this->$var = $info[$var];