From: Aaron Schulz Date: Tue, 2 Jun 2015 00:23:06 +0000 (-0700) Subject: Made User::touch no longer call load() X-Git-Tag: 1.31.0-rc.0~11197^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/message.php?a=commitdiff_plain;h=5b2670b31b913a43bc98ea6d1a74e13a5de0237a;p=lhc%2Fweb%2Fwiklou.git Made User::touch no longer call load() * Just reset mQuickTouched instead of guessing a new value in touch() for simplicity Change-Id: Ibfe551cf061919ab18c4ff634d8db8f3c0eaf0a5 --- diff --git a/includes/User.php b/includes/User.php index eb2a2dc2ed..6d3911be22 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2303,8 +2303,8 @@ class User implements IDBAccessObject { public function clearSharedCache() { $id = $this->getId(); if ( $id ) { - $cache = ObjectCache::getMainWANInstance(); - $cache->delete( wfMemcKey( 'user', 'id', $id ) ); + $key = wfMemcKey( 'user', 'id', $id ); + ObjectCache::getMainWANInstance()->delete( $key ); } } @@ -2331,14 +2331,11 @@ class User implements IDBAccessObject { * @since 1.25 */ public function touch() { - $this->load(); - - if ( $this->mId ) { - $this->mQuickTouched = $this->newTouchedTimestamp(); - - $cache = ObjectCache::getMainWANInstance(); - $key = wfMemcKey( 'user-quicktouched', 'id', $this->mId ); - $cache->touchCheckKey( $key ); + $id = $this->getId(); + if ( $id ) { + $key = wfMemcKey( 'user-quicktouched', 'id', $id ); + ObjectCache::getMainWANInstance()->touchCheckKey( $key ); + $this->mQuickTouched = null; } }