|
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, RestrictionStore $restrictionStore, 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 54 of file BacklinkCache.php.
| MediaWiki\Cache\BacklinkCache::__construct | ( | ServiceOptions | $options, |
| LinksMigration | $linksMigration, | ||
| WANObjectCache | $wanCache, | ||
| HookContainer | $hookContainer, | ||
| IConnectionProvider | $dbProvider, | ||
| RestrictionStore | $restrictionStore, | ||
| LoggerInterface | $logger, | ||
| PageReference | $page ) |
Create a new BacklinkCache.
| ServiceOptions | $options | |
| LinksMigration | $linksMigration | |
| WANObjectCache | $wanCache | |
| HookContainer | $hookContainer | |
| IConnectionProvider | $dbProvider | |
| RestrictionStore | $restrictionStore | |
| LoggerInterface | $logger | |
| PageReference | $page | Page to create a backlink cache for |
Definition at line 122 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 532 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 170 of file BacklinkCache.php.
| MediaWiki\Cache\BacklinkCache::getNumLinks | ( | $table | ) |
Get the approximate number of backlinks.
| string | $table |
Definition at line 382 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 361 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 420 of file BacklinkCache.php.
| const MediaWiki\Cache\BacklinkCache::CONSTRUCTOR_OPTIONS |
Definition at line 58 of file BacklinkCache.php.