resourceloader: Make ResourceLoader logger aware
[lhc/web/wiklou.git] / includes / User.php
index 7902119..bf0326a 100644 (file)
@@ -1229,7 +1229,7 @@ class User implements IDBAccessObject {
                        self::selectFields(),
                        array( 'user_id' => $this->mId ),
                        __METHOD__,
-                       ( $flags & self::READ_LOCKING == self::READ_LOCKING )
+                       ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING )
                                ? array( 'LOCK IN SHARE MODE' )
                                : array()
                );
@@ -2301,11 +2301,10 @@ class User implements IDBAccessObject {
         * Called implicitly from invalidateCache() and saveSettings().
         */
        public function clearSharedCache() {
-               $this->load();
-               if ( $this->mId ) {
-                       $cache = ObjectCache::getMainWANInstance();
-
-                       $cache->delete( wfMemcKey( 'user', 'id', $this->mId ) );
+               $id = $this->getId();
+               if ( $id ) {
+                       $key = wfMemcKey( 'user', 'id', $id );
+                       ObjectCache::getMainWANInstance()->delete( $key );
                }
        }
 
@@ -2332,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;
                }
        }
 
@@ -2384,7 +2380,7 @@ class User implements IDBAccessObject {
         * @return string TS_MW Timestamp
         * @since 1.26
         */
-       protected function getDBTouched() {
+       public function getDBTouched() {
                $this->load();
 
                return $this->mTouched;