Creates a database of keys in all groups, so that namespace and key can be used to get the groups they belong to. More...
Public Member Functions | |
__construct (MessageIndexStore $store, WANObjectCache $statusCache, JobQueueGroup $jobQueueGroup, HookRunner $hookRunner, LoggerInterface $logger, BagOStuff $interimCache, IConnectionProvider $connectionProvider, MessageGroupSubscription $messageGroupSubscription, ServiceOptions $options) | |
getGroupIds (MessageHandle $handle) | |
Retrieves a list of groups given MessageHandle belongs to. | |
getGroupIdsForDatabaseTitle (int $namespace, string $title) | |
Fast-path to retrieve groups for database titles. | |
getPrimaryGroupId (MessageHandle $handle) | |
get (string $key) | |
getKeys () | |
rebuild (float $timestamp=null) | |
Creates the index from scratch. | |
getStatusCacheKey () | |
storeInterim (MessageGroup $group, array $newKeys) | |
getArrayDiff (array $old, array $new) | |
Compares two associative arrays. | |
Public Attributes | |
const | SERVICE_OPTIONS |
Protected Member Functions | |
clearMessageGroupStats (array $diff) | |
Purge stuff when set of keys have changed. | |
checkAndAdd (array &$hugeArray, MessageGroup $g, bool $ignore=false) | |
Protected Attributes | |
BagOStuff | $interimCache |
Creates a database of keys in all groups, so that namespace and key can be used to get the groups they belong to.
This is used as a fallback when loadgroup parameter is not provided in the request, which happens if someone reaches a messages from somewhere else than Special:Translate. Also used by Special:TranslationStats and alike which need to map lots of titles to message groups.
Definition at line 33 of file MessageIndex.php.
MediaWiki\Extension\Translate\MessageLoading\MessageIndex::__construct | ( | MessageIndexStore | $store, |
WANObjectCache | $statusCache, | ||
JobQueueGroup | $jobQueueGroup, | ||
HookRunner | $hookRunner, | ||
LoggerInterface | $logger, | ||
BagOStuff | $interimCache, | ||
IConnectionProvider | $connectionProvider, | ||
MessageGroupSubscription | $messageGroupSubscription, | ||
ServiceOptions | $options ) |
Definition at line 51 of file MessageIndex.php.
|
protected |
Definition at line 411 of file MessageIndex.php.
|
protected |
Purge stuff when set of keys have changed.
Definition at line 394 of file MessageIndex.php.
MediaWiki\Extension\Translate\MessageLoading\MessageIndex::get | ( | string | $key | ) |
Definition at line 142 of file MessageIndex.php.
MediaWiki\Extension\Translate\MessageLoading\MessageIndex::getArrayDiff | ( | array | $old, |
array | $new ) |
Compares two associative arrays.
Values must be a string or list of strings. Returns an array of added, deleted and modified keys as well as value changes (you can think values as categories and keys as pages). Each of the keys ('add', 'del', 'mod' respectively) maps to an array whose keys are the changed keys of the original arrays and values are lists where first element contains the old value and the second element the new value.
array | $old | |
array | $new |
Definition at line 353 of file MessageIndex.php.
MediaWiki\Extension\Translate\MessageLoading\MessageIndex::getGroupIds | ( | MessageHandle | $handle | ) |
Retrieves a list of groups given MessageHandle belongs to.
Definition at line 86 of file MessageIndex.php.
MediaWiki\Extension\Translate\MessageLoading\MessageIndex::getGroupIdsForDatabaseTitle | ( | int | $namespace, |
string | $title ) |
Fast-path to retrieve groups for database titles.
Performance is critical for stats that need to check groups for many rows. Do not include the language code subpage!
Definition at line 113 of file MessageIndex.php.
MediaWiki\Extension\Translate\MessageLoading\MessageIndex::getKeys | ( | ) |
Definition at line 147 of file MessageIndex.php.
MediaWiki\Extension\Translate\MessageLoading\MessageIndex::getPrimaryGroupId | ( | MessageHandle | $handle | ) |
Definition at line 122 of file MessageIndex.php.
MediaWiki\Extension\Translate\MessageLoading\MessageIndex::getStatusCacheKey | ( | ) |
Definition at line 284 of file MessageIndex.php.
MediaWiki\Extension\Translate\MessageLoading\MessageIndex::rebuild | ( | float | $timestamp = null | ) |
Creates the index from scratch.
float | null | $timestamp | Purge interim caches older than this timestamp. |
Exception |
Definition at line 183 of file MessageIndex.php.
MediaWiki\Extension\Translate\MessageLoading\MessageIndex::storeInterim | ( | MessageGroup | $group, |
array | $newKeys ) |
Definition at line 292 of file MessageIndex.php.
|
protected |
Definition at line 39 of file MessageIndex.php.
const MediaWiki\Extension\Translate\MessageLoading\MessageIndex::SERVICE_OPTIONS |
Definition at line 47 of file MessageIndex.php.