Use getMainObjectStash from MediawikiServices in static UploadBase methods
authoraddshore <addshorewiki@gmail.com>
Tue, 21 Feb 2017 16:53:52 +0000 (16:53 +0000)
committerAddshore <addshorewiki@gmail.com>
Sat, 4 Mar 2017 11:49:05 +0000 (11:49 +0000)
Change-Id: Ic547efe231c1457b2028301b9db055d3d4e6abfe

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 {