X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fuser%2FUser.php;h=ee617a2caf9bc31c3ad2fe50f9f8c0aaba18db4f;hb=6164423de0f34b5c264bacebb8371811e07fdaa8;hp=7c32c3b5a2559891c2e6774f0c0b69a34ce0a640;hpb=6a8de1f1aa0bcdbf9385a4f9a01a4ef3bb70be57;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/user/User.php b/includes/user/User.php index 7c32c3b5a2..ee617a2caf 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -475,7 +475,7 @@ class User implements IDBAccessObject { */ protected static function getInProcessCache() { if ( !self::$inProcessCache ) { - self::$inProcessCache = new HashBagOStuff( ['maxKeys' => 10] ); + self::$inProcessCache = new HashBagOStuff( [ 'maxKeys' => 10 ] ); } return self::$inProcessCache; } @@ -3500,7 +3500,7 @@ class User implements IDBAccessObject { */ public function isWatched( $title, $checkRights = self::CHECK_USER_RIGHTS ) { if ( $title->isWatchable() && ( !$checkRights || $this->isAllowed( 'viewmywatchlist' ) ) ) { - return WatchedItemStore::getDefaultInstance()->isWatched( $this, $title ); + return MediaWikiServices::getInstance()->getWatchedItemStore()->isWatched( $this, $title ); } return false; } @@ -3514,7 +3514,7 @@ class User implements IDBAccessObject { */ public function addWatch( $title, $checkRights = self::CHECK_USER_RIGHTS ) { if ( !$checkRights || $this->isAllowed( 'editmywatchlist' ) ) { - WatchedItemStore::getDefaultInstance()->addWatchBatchForUser( + MediaWikiServices::getInstance()->getWatchedItemStore()->addWatchBatchForUser( $this, [ $title->getSubjectPage(), $title->getTalkPage() ] ); @@ -3531,8 +3531,9 @@ class User implements IDBAccessObject { */ public function removeWatch( $title, $checkRights = self::CHECK_USER_RIGHTS ) { if ( !$checkRights || $this->isAllowed( 'editmywatchlist' ) ) { - WatchedItemStore::getDefaultInstance()->removeWatch( $this, $title->getSubjectPage() ); - WatchedItemStore::getDefaultInstance()->removeWatch( $this, $title->getTalkPage() ); + $store = MediaWikiServices::getInstance()->getWatchedItemStore(); + $store->removeWatch( $this, $title->getSubjectPage() ); + $store->removeWatch( $this, $title->getTalkPage() ); } $this->invalidateCache(); } @@ -3601,7 +3602,7 @@ class User implements IDBAccessObject { $force = 'force'; } - WatchedItemStore::getDefaultInstance() + MediaWikiServices::getInstance()->getWatchedItemStore() ->resetNotificationTimestamp( $this, $title, $force, $oldid ); }