MediaWiki
master
|
LocalisationCache optimised for loading many languages at once. More...
Public Member Functions | |
getItem ( $code, $key) | |
getSubitem ( $code, $key, $subkey) | |
recache ( $code) | |
unload ( $code) | |
![]() | |
__construct (ServiceOptions $options, LCStore $store, LoggerInterface $logger, array $clearStoreCallbacks, LanguageNameUtils $langNameUtils, HookContainer $hookContainer) | |
For constructor parameters, \MediaWiki\MainConfigSchema::LocalisationCacheConf. More... | |
disableBackend () | |
Disable the storage backend. More... | |
getCompiledPluralRules ( $code) | |
Get the compiled plural rules for a given language from the XML files. More... | |
getMessagesDirs () | |
Gets the combined list of messages dirs from core and extensions. More... | |
getPluralRules ( $code) | |
Get the plural rules for a given language from the XML files. More... | |
getPluralRuleTypes ( $code) | |
Get the plural rule types for a given language from the XML files. More... | |
getSubitemList ( $code, $key) | |
Get the list of subitem keys for a given item. More... | |
initShallowFallback ( $primaryCode, $fallbackCode) | |
Create a fallback from one language to another, without creating a complete persistent cache. More... | |
isExpired ( $code) | |
Returns true if the cache identified by $code is missing or expired. More... | |
isMergeableKey ( $key) | |
Returns true if the given key is mergeable, that is, if it is an associative array which can be merged through a fallback sequence. More... | |
readJSONFile ( $fileName) | |
Read a JSON file containing localisation messages. More... | |
unloadAll () | |
Unload all data. More... | |
Protected Member Functions | |
readPHPFile ( $fileName, $fileType) | |
trimCache () | |
Unload cached languages until there are less than $this->maxLoadedLangs. More... | |
![]() | |
buildPreload ( $data) | |
Build the preload item from the given pre-cache data. More... | |
initLanguage ( $code) | |
Initialise a language in this object. More... | |
loadItem ( $code, $key) | |
Load an item into the cache. More... | |
loadPluralFile ( $fileName) | |
Load a plural XML file with the given filename, compile the relevant rules, and save the compiled rules in a process-local cache. More... | |
loadPluralFiles () | |
Load the plural XML files. More... | |
loadSubitem ( $code, $key, $subkey) | |
Load a subitem into the cache. More... | |
mergeItem ( $key, &$value, $fallbackValue) | |
Merge two localisation values, a primary and a fallback, overwriting the primary value in place. More... | |
mergeMagicWords (&$value, $fallbackValue) | |
readSourceFilesAndRegisterDeps ( $code, &$deps) | |
Read the data from the source files for a given language, and register the relevant dependencies in the $deps array. More... | |
Additional Inherited Members | |
![]() | |
static | getStoreFromConf (array $conf, $fallbackCacheDir) |
Return a suitable LCStore as specified by the given configuration. More... | |
![]() | |
const | CONSTRUCTOR_OPTIONS |
const | VERSION = 4 |
![]() | |
static | $allKeys |
All item keys. More... | |
static | $magicWordKeys = [ 'magicWords' ] |
Keys for items that are formatted like $magicWords. More... | |
static | $mergeableAliasListKeys = [ 'specialPageAliases' ] |
Keys for items which contain an array of arrays of equivalent aliases for each subitem. More... | |
static | $mergeableListKeys = [] |
Keys for items which are a numbered array. More... | |
static | $mergeableMapKeys |
Keys for items which consist of associative arrays, which may be merged by a fallback sequence. More... | |
static | $optionalMergeKeys = [ 'bookstoreList' ] |
Keys for items which contain an associative array, and may be merged if the primary value contains the special array key "inherit". More... | |
static | $preloadedKeys = [ 'dateFormats', 'namespaceNames' ] |
Keys which are loaded automatically by initLanguage() More... | |
static | $splitKeys = [ 'messages' ] |
Keys for items where the subitems are stored in the backend separately. More... | |
![]() | |
$data = [] | |
The cache data. More... | |
LocalisationCache optimised for loading many languages at once.
Used by maintenance/rebuildLocalisationCache.php.
Definition at line 28 of file LocalisationCacheBulkLoad.php.
LocalisationCacheBulkLoad::getItem | ( | $code, | |
$key | |||
) |
string | $code | |
string | $key |
Reimplemented from LocalisationCache.
Definition at line 79 of file LocalisationCacheBulkLoad.php.
LocalisationCacheBulkLoad::getSubitem | ( | $code, | |
$key, | |||
$subkey | |||
) |
string | $code | |
string | $key | |
string | $subkey |
Reimplemented from LocalisationCache.
Definition at line 92 of file LocalisationCacheBulkLoad.php.
|
protected |
string | $fileName | |
string | $fileType |
Reimplemented from LocalisationCache.
Definition at line 53 of file LocalisationCacheBulkLoad.php.
References LocalisationCache\$data.
LocalisationCacheBulkLoad::recache | ( | $code | ) |
string | $code |
Reimplemented from LocalisationCache.
Definition at line 102 of file LocalisationCacheBulkLoad.php.
References trimCache().
|
protected |
Unload cached languages until there are less than $this->maxLoadedLangs.
Definition at line 120 of file LocalisationCacheBulkLoad.php.
References unload(), and wfDebug().
Referenced by recache().
LocalisationCacheBulkLoad::unload | ( | $code | ) |
string | $code |
Reimplemented from LocalisationCache.
Definition at line 112 of file LocalisationCacheBulkLoad.php.
Referenced by trimCache().