* @return bool|string
*/
function getThumbUrlFromCache( $name, $width, $height, $params = "" ) {
- global $wgMemc;
+ $cache = ObjectCache::getMainWANInstance();
// We can't check the local cache using FileRepo functions because
// we override fileExistsBatch(). We have to use the FileBackend directly.
$backend = $this->getBackend(); // convenience
$sizekey = "$width:$height:$params";
/* Get the array of urls that we already know */
- $knownThumbUrls = $wgMemc->get( $key );
+ $knownThumbUrls = $cache->get( $key );
if ( !$knownThumbUrls ) {
/* No knownThumbUrls for this file */
$knownThumbUrls = array();
if ( $remoteModified < $modified && $diff < $this->fileCacheExpiry ) {
/* Use our current and already downloaded thumbnail */
$knownThumbUrls[$sizekey] = $localUrl;
- $wgMemc->set( $key, $knownThumbUrls, $this->apiThumbCacheExpiry );
+ $cache->set( $key, $knownThumbUrls, $this->apiThumbCacheExpiry );
return $localUrl;
}
return $foreignUrl;
}
$knownThumbUrls[$sizekey] = $localUrl;
- $wgMemc->set( $key, $knownThumbUrls, $this->apiThumbCacheExpiry );
+ $cache->set( $key, $knownThumbUrls, $this->apiThumbCacheExpiry );
wfDebug( __METHOD__ . " got local thumb $localUrl, saving to cache \n" );
return $localUrl;