protected $rclistOpen;
protected $rcMoveIndex;
- /** @var MapCacheLRU */
- protected $watchingCache;
+ /** @var BagOStuff */
+ protected $watchMsgCache;
/**
* Changeslist constructor
$this->skin = $obj;
}
$this->preCacheMessages();
- $this->watchingCache = new MapCacheLRU( 50 );
+ $this->watchMsgCache = new HashBagOStuff( array( 'maxKeys' => 50 ) );
}
/**
* @return string
*/
protected function numberofWatchingusers( $count ) {
- $cache = $this->watchingCache;
- if ( $count > 0 ) {
- if ( !$cache->has( $count ) ) {
- $cache->set( $count, $this->msg( 'number_of_watching_users_RCview' )
- ->numParams( $count )->escaped() );
- }
-
- return $cache->get( $count );
- } else {
+ if ( $count <= 0 ) {
return '';
}
+ $cache = $this->watchMsgCache;
+ $that = $this;
+ return $cache->getWithSetCallback( $count, $cache::TTL_INDEFINITE,
+ function () use ( $that, $count ) {
+ return $that->msg( 'number_of_watching_users_RCview' )
+ ->numParams( $count )->escaped();
+ }
+ );
}
/**