From: Kunal Mehta Date: Thu, 25 May 2017 07:47:56 +0000 (-0700) Subject: UploadBase: Avoid deprecated wfMemcKey() X-Git-Tag: 1.31.0-rc.0~3123^2 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=316641798f502f5a576796758ffef12c45182da3;p=lhc%2Fweb%2Fwiklou.git UploadBase: Avoid deprecated wfMemcKey() Change-Id: I717948d6550ed2d98c3a89b3e48e161c3af15d48 --- diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 55fb68529f..0868ce669e 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -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 {