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 | |
retrieve (bool $readLatest=false) | |
getKeys () | |
rebuild (float $timestamp=null) | |
Creates the index from scratch. | |
getStatusCacheKey () | |
storeInterim (MessageGroup $group, array $newKeys) | |
Static Public Member Functions | |
static | singleton () |
static | setInstance (self $instance) |
Override the global instance, for testing. | |
static | getGroupIds (MessageHandle $handle) |
Retrieves a list of groups given MessageHandle belongs to. | |
static | getPrimaryGroupId (MessageHandle $handle) |
static | getArrayDiff (array $old, array $new) |
Compares two associative arrays. | |
Protected Member Functions | |
get ( $key) | |
Looks up the stored value for single key. | |
store (array $array, array $diff) | |
lock () | |
unlock () | |
clearMessageGroupStats (array $diff) | |
Purge stuff when set of keys have changed. | |
checkAndAdd (&$hugearray, MessageGroup $g, $ignore=false) | |
serialize ( $data) | |
These are probably slower than serialize and unserialize, but they are more space efficient because we only need strings and arrays. | |
unserialize ( $data) | |
Protected Attributes | |
$interimCache | |
Static Protected Attributes | |
static | $instance |
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 27 of file MessageIndex.php.
MessageIndex::__construct | ( | ) |
Definition at line 43 of file MessageIndex.php.
|
protected |
array | &$hugearray | |
MessageGroup | $g | |
bool | $ignore |
Definition at line 391 of file MessageIndex.php.
|
protected |
Purge stuff when set of keys have changed.
array | $diff |
Reimplemented in HashMessageIndex.
Definition at line 370 of file MessageIndex.php.
|
protected |
Looks up the stored value for single key.
Only for testing.
string | $key |
Reimplemented in DatabaseMessageIndex, CDBMessageIndex, and HashMessageIndex.
Definition at line 135 of file MessageIndex.php.
|
static |
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 325 of file MessageIndex.php.
|
static |
Retrieves a list of groups given MessageHandle belongs to.
MessageHandle | $handle |
Definition at line 78 of file MessageIndex.php.
MessageIndex::getKeys | ( | ) |
Reimplemented in CDBMessageIndex.
Definition at line 147 of file MessageIndex.php.
|
static |
MessageHandle | $handle |
Definition at line 114 of file MessageIndex.php.
MessageIndex::getStatusCacheKey | ( | ) |
|
protected |
Definition at line 153 of file MessageIndex.php.
MessageIndex::rebuild | ( | float | $timestamp = null | ) |
Creates the index from scratch.
float | null | $timestamp | Purge interim caches older than this timestamp. |
Exception |
Definition at line 168 of file MessageIndex.php.
|
abstract |
Reimplemented in CDBMessageIndex.
|
protected |
These are probably slower than serialize and unserialize, but they are more space efficient because we only need strings and arrays.
mixed | $data |
Definition at line 432 of file MessageIndex.php.
|
static |
Override the global instance, for testing.
MessageIndex | $instance |
Definition at line 68 of file MessageIndex.php.
|
static |
Definition at line 54 of file MessageIndex.php.
MessageIndex::storeInterim | ( | MessageGroup | $group, |
array | $newKeys ) |
Definition at line 273 of file MessageIndex.php.
|
protected |
Definition at line 157 of file MessageIndex.php.
|
protected |
Definition at line 440 of file MessageIndex.php.
|
staticprotected |
Definition at line 33 of file MessageIndex.php.
|
protected |
Definition at line 37 of file MessageIndex.php.