User: Avoid deprecated wfMemcKey()
authorKunal Mehta <legoktm@member.fsf.org>
Thu, 25 May 2017 19:17:27 +0000 (12:17 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Thu, 25 May 2017 19:17:27 +0000 (12:17 -0700)
And ObjectCache::getMainWANInstance() while we're at it.

Change-Id: Id0280aec72202f3b3098c9c3b563541c2c0f2900

includes/user/User.php

index 131e419..99610c3 100644 (file)
@@ -2527,8 +2527,9 @@ class User implements IDBAccessObject {
        public function touch() {
                $id = $this->getId();
                if ( $id ) {
-                       $key = wfMemcKey( 'user-quicktouched', 'id', $id );
-                       ObjectCache::getMainWANInstance()->touchCheckKey( $key );
+                       $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
+                       $key = $cache->makeKey( 'user-quicktouched', 'id', $id );
+                       $cache->touchCheckKey( $key );
                        $this->mQuickTouched = null;
                }
        }
@@ -2555,8 +2556,8 @@ class User implements IDBAccessObject {
 
                if ( $this->mId ) {
                        if ( $this->mQuickTouched === null ) {
-                               $key = wfMemcKey( 'user-quicktouched', 'id', $this->mId );
-                               $cache = ObjectCache::getMainWANInstance();
+                               $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
+                               $key = $cache->makeKey( 'user-quicktouched', 'id', $this->mId );
 
                                $this->mQuickTouched = wfTimestamp( TS_MW, $cache->getCheckKeyTime( $key ) );
                        }