MediaWiki REL1_40
BacklinkCacheFactory.php
Go to the documentation of this file.
1<?php
25
30
36 private $latestBacklinkCache;
37
39 private $wanCache;
40
42 private $hookContainer;
43
48 public function __construct(
49 WANObjectCache $wanCache,
50 HookContainer $hookContainer
51 ) {
52 $this->wanCache = $wanCache;
53 $this->hookContainer = $hookContainer;
54 }
55
66 public function getBacklinkCache( PageReference $page ): BacklinkCache {
67 if ( !$this->latestBacklinkCache || !$this->latestBacklinkCache->getPage()->isSamePageAs( $page ) ) {
68 $this->latestBacklinkCache = new BacklinkCache(
69 $this->wanCache,
70 $this->hookContainer,
71 $page
72 );
73 }
74 return $this->latestBacklinkCache;
75 }
76}
if(!defined('MW_SETUP_CALLBACK'))
The persistent session ID (if any) loaded at startup.
Definition WebStart.php:88
Class for fetching backlink lists, approximate backlink counts and partitions.
__construct(WANObjectCache $wanCache, HookContainer $hookContainer)
getBacklinkCache(PageReference $page)
Returns a BacklinkCache for $page.
Multi-datacenter aware caching interface.
Interface for objects (potentially) representing a page that can be viewable and linked to on a wiki.