* Introduced by r47317
*/
class BacklinkCache {
- /** @var ProcessCacheLRU */
- protected static $cache;
+ /** @var BacklinkCache */
+ protected static $instance;
/**
* Multi dimensions array representing batches. Keys are:
* @return BacklinkCache
*/
public static function get( Title $title ) {
- if ( !self::$cache ) { // init cache
- self::$cache = new ProcessCacheLRU( 1 );
+ if ( !self::$instance || !self::$instance->title->equals( $title ) ) {
+ self::$instance = new self( $title );
}
- $dbKey = $title->getPrefixedDBkey();
- if ( !self::$cache->has( $dbKey, 'obj', 3600 ) ) {
- self::$cache->set( $dbKey, 'obj', new self( $title ) );
- }
-
- return self::$cache->get( $dbKey, 'obj' );
+ return self::$instance;
}
/**