Use getMainObjectStash from MediawikiServices in static UploadBase methods

Change-Id: Ic547efe231c1457b2028301b9db055d3d4e6abfe
This commit is contained in:
addshore 2017-02-21 16:53:52 +00:00 committed by Addshore
parent abc5543c06
commit d2bf8056b7

View file

@ -20,6 +20,7 @@
* @file * @file
* @ingroup Upload * @ingroup Upload
*/ */
use MediaWiki\MediaWikiServices;
/** /**
* @defgroup Upload Upload related * @defgroup Upload Upload related
@ -2083,7 +2084,7 @@ abstract class UploadBase {
public static function getSessionStatus( User $user, $statusKey ) { public static function getSessionStatus( User $user, $statusKey ) {
$key = wfMemcKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $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 ) { public static function setSessionStatus( User $user, $statusKey, $value ) {
$key = wfMemcKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $statusKey ); $key = wfMemcKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $statusKey );
$cache = ObjectCache::getMainStashInstance(); $cache = MediaWikiServices::getInstance()->getMainObjectStash();
if ( $value === false ) { if ( $value === false ) {
$cache->delete( $key ); $cache->delete( $key );
} else { } else {