filerepo: clean up remote description cache keys
[lhc/web/wiklou.git] / includes / filerepo / file / ForeignDBFile.php
index 388e950..7a982bd 100644 (file)
@@ -21,6 +21,7 @@
  * @ingroup FileAbstraction
  */
 
+use MediaWiki\MediaWikiServices;
 use Wikimedia\Rdbms\DBUnexpectedError;
 
 /**
@@ -150,14 +151,13 @@ class ForeignDBFile extends LocalFile {
                        return false; // no description page
                }
 
-               $cache = ObjectCache::getMainWANInstance();
+               $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
 
                return $cache->getWithSetCallback(
                        $this->repo->getLocalCacheKey(
-                               'RemoteFileDescription',
-                               'url',
+                               'ForeignFileDescription',
                                $lang->getCode(),
-                               $this->getName(),
+                               md5( $this->getName() ),
                                $touched
                        ),
                        $this->repo->descriptionCacheExpiry ?: $cache::TTL_UNCACHEABLE,