|
MediaWiki master
|
Factory for LinkBatch objects to batch query page metadata. More...
Public Member Functions | |
| __construct (private LinkCache $linkCache, private TitleFormatter $titleFormatter, private Language $contentLanguage, private GenderCache $genderCache, private IConnectionProvider $dbProvider, private LinksMigration $linksMigration, private TempUserDetailsLookup $tempUserDetailsLookup, private LinkAlwaysKnownLookup $linkAlwaysKnownLookup, private LoggerInterface $logger) | |
| newLinkBatch (iterable $titles=[]) | |
| preloadPersistentCache (array $pages, string $fname) | |
| Warm-up titles that qualify for the persistent version of LinkCache. | |
Factory for LinkBatch objects to batch query page metadata.
Use via MediaWikiServices::getLinkBatchFactory()->newLinkBatch(), and then call LinkBatch::execute().
Definition at line 29 of file LinkBatchFactory.php.
| MediaWiki\Page\LinkBatchFactory::__construct | ( | private LinkCache | $linkCache, |
| private TitleFormatter | $titleFormatter, | ||
| private Language | $contentLanguage, | ||
| private GenderCache | $genderCache, | ||
| private IConnectionProvider | $dbProvider, | ||
| private LinksMigration | $linksMigration, | ||
| private TempUserDetailsLookup | $tempUserDetailsLookup, | ||
| private LinkAlwaysKnownLookup | $linkAlwaysKnownLookup, | ||
| private LoggerInterface | $logger ) |
Definition at line 31 of file LinkBatchFactory.php.
| MediaWiki\Page\LinkBatchFactory::newLinkBatch | ( | iterable | $titles = [] | ) |
| iterable<LinkTarget>|iterable<PageReference> | $titles Initial titles for this batch |
Definition at line 48 of file LinkBatchFactory.php.
| MediaWiki\Page\LinkBatchFactory::preloadPersistentCache | ( | array | $pages, |
| string | $fname ) |
Warm-up titles that qualify for the persistent version of LinkCache.
If your use case involves a set of titles that:
Then consider using this method instead of ::newLinkBatch.
This method tries WANObjectCache first and falls back to backfilling from a database query using ::newLinkBatch. It then warms up the in-process LinkCache with the results.
Designed for use by ResourceLoader\WikiModule::preloadTitleInfo (T393835).
| string[] | $pages |
Definition at line 84 of file LinkBatchFactory.php.