Merge "Use getMainObjectStash from MediawikiServices in static UploadBase methods"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 5 Mar 2017 13:30:05 +0000 (13:30 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 5 Mar 2017 13:30:05 +0000 (13:30 +0000)
includes/upload/UploadBase.php

index bac7129..733c4ff 100644 (file)
@@ -20,6 +20,7 @@
  * @file
  * @ingroup Upload
  */
+use MediaWiki\MediaWikiServices;
 
 /**
  * @defgroup Upload Upload related
@@ -2083,7 +2084,7 @@ abstract class UploadBase {
        public static function getSessionStatus( User $user, $statusKey ) {
                $key = wfMemcKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $statusKey );
 
-               return ObjectCache::getMainStashInstance()->get( $key );
+               return MediaWikiServices::getInstance()->getMainObjectStash()->get( $key );
        }
 
        /**
@@ -2099,7 +2100,7 @@ abstract class UploadBase {
        public static function setSessionStatus( User $user, $statusKey, $value ) {
                $key = wfMemcKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $statusKey );
 
-               $cache = ObjectCache::getMainStashInstance();
+               $cache = MediaWikiServices::getInstance()->getMainObjectStash();
                if ( $value === false ) {
                        $cache->delete( $key );
                } else {