MediaWiki master
|
Class for fetching backlink lists, approximate backlink counts and partitions. More...
Public Member Functions | |
__construct (ServiceOptions $options, LinksMigration $linksMigration, WANObjectCache $wanCache, HookContainer $hookContainer, IConnectionProvider $dbProvider, LoggerInterface $logger, PageReference $page) | |
Create a new BacklinkCache. | |
getCascadeProtectedLinkPages () | |
Get a PageIdentity iterator for cascade-protected template/file use backlinks. | |
getLinkPages (string $table, $startId=false, $endId=false, $max=INF) | |
Get the backlinks for a given table. | |
getNumLinks ( $table) | |
Get the approximate number of backlinks. | |
getPage () | |
hasLinks ( $table) | |
Check if there are any backlinks. | |
partition ( $table, $batchSize) | |
Partition the backlinks into batches. | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Class for fetching backlink lists, approximate backlink counts and partitions.
This is a shared cache.
Instances of this class should typically be fetched with the method ::getBacklinkCache() from the BacklinkCacheFactory service.
Ideally you should only get your backlinks from here when you think there is some advantage in caching them. Otherwise, it's just a waste of memory.
Definition at line 63 of file BacklinkCache.php.
MediaWiki\Cache\BacklinkCache::__construct | ( | ServiceOptions | $options, |
LinksMigration | $linksMigration, | ||
WANObjectCache | $wanCache, | ||
HookContainer | $hookContainer, | ||
IConnectionProvider | $dbProvider, | ||
LoggerInterface | $logger, | ||
PageReference | $page ) |
Create a new BacklinkCache.
ServiceOptions | $options | |
LinksMigration | $linksMigration | |
WANObjectCache | $wanCache | |
HookContainer | $hookContainer | |
IConnectionProvider | $dbProvider | |
LoggerInterface | $logger | |
PageReference | $page | Page to create a backlink cache for |
Definition at line 129 of file BacklinkCache.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions().
MediaWiki\Cache\BacklinkCache::getCascadeProtectedLinkPages | ( | ) |
Get a PageIdentity iterator for cascade-protected template/file use backlinks.
Definition at line 525 of file BacklinkCache.php.
MediaWiki\Cache\BacklinkCache::getLinkPages | ( | string | $table, |
$startId = false, | |||
$endId = false, | |||
$max = INF ) |
Get the backlinks for a given table.
Cached in process memory only.
string | $table | |
int | bool | $startId | |
int | bool | $endId | |
int | float | $max | Integer, or INF for no max |
Definition at line 174 of file BacklinkCache.php.
MediaWiki\Cache\BacklinkCache::getNumLinks | ( | $table | ) |
Get the approximate number of backlinks.
string | $table |
Definition at line 375 of file BacklinkCache.php.
MediaWiki\Cache\BacklinkCache::getPage | ( | ) |
MediaWiki\Cache\BacklinkCache::hasLinks | ( | $table | ) |
Check if there are any backlinks.
Only use the process cache, since the WAN cache is potentially stale (T368006).
string | $table |
Definition at line 354 of file BacklinkCache.php.
MediaWiki\Cache\BacklinkCache::partition | ( | $table, | |
$batchSize ) |
Partition the backlinks into batches.
Returns an array giving the start and end of each range. The first batch has a start of false, and the last batch has an end of false.
string | $table | The links table name |
int | $batchSize |
Definition at line 413 of file BacklinkCache.php.
const MediaWiki\Cache\BacklinkCache::CONSTRUCTOR_OPTIONS |
Definition at line 67 of file BacklinkCache.php.