media: Avoid deprecated wfMemcKey()
authorKunal Mehta <legoktm@member.fsf.org>
Wed, 24 May 2017 03:41:48 +0000 (20:41 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Wed, 24 May 2017 04:01:09 +0000 (21:01 -0700)
And ObjectCache::getMainWANInstance() while we're at it.

Change-Id: Ib22bd134c3faa56f8d8f111bb9ed99d826cbed40

includes/media/FormatMetadata.php

index 2c541e0..6b4ac8b 100644 (file)
@@ -24,6 +24,7 @@
  * @see http://exif.org/Exif2-2.PDF The Exif 2.2 specification
  * @file
  */
+use MediaWiki\MediaWikiServices;
 use Wikimedia\Timestamp\TimestampException;
 
 /**
@@ -1584,14 +1585,14 @@ class FormatMetadata extends ContextSource {
         * @since 1.23
         */
        public function fetchExtendedMetadata( File $file ) {
-               $cache = ObjectCache::getMainWANInstance();
+               $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
 
                // If revision deleted, exit immediately
                if ( $file->isDeleted( File::DELETED_FILE ) ) {
                        return [];
                }
 
-               $cacheKey = wfMemcKey(
+               $cacheKey = $cache->makeKey(
                        'getExtendedMetadata',
                        $this->getLanguage()->getCode(),
                        (int)$this->singleLang,