UploadBase: Avoid deprecated wfMemcKey()
authorKunal Mehta <legoktm@member.fsf.org>
Thu, 25 May 2017 07:47:56 +0000 (00:47 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Thu, 25 May 2017 18:20:24 +0000 (11:20 -0700)
Change-Id: I717948d6550ed2d98c3a89b3e48e161c3af15d48

includes/upload/UploadBase.php

index 55fb685..0868ce6 100644 (file)
@@ -2113,9 +2113,10 @@ abstract class UploadBase {
         * @return Status[]|bool
         */
        public static function getSessionStatus( User $user, $statusKey ) {
-               $key = wfMemcKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $statusKey );
+               $cache = MediaWikiServices::getInstance()->getMainObjectStash();
+               $key = $cache->makeKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $statusKey );
 
-               return MediaWikiServices::getInstance()->getMainObjectStash()->get( $key );
+               return $cache->get( $key );
        }
 
        /**
@@ -2129,9 +2130,9 @@ abstract class UploadBase {
         * @return void
         */
        public static function setSessionStatus( User $user, $statusKey, $value ) {
-               $key = wfMemcKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $statusKey );
-
                $cache = MediaWikiServices::getInstance()->getMainObjectStash();
+               $key = $cache->makeKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $statusKey );
+
                if ( $value === false ) {
                        $cache->delete( $key );
                } else {