MediaWiki master
LocalisationCacheBulkLoad Class Reference

LocalisationCache optimised for loading many languages at once. More...

Inherits LocalisationCache.

Collaboration diagram for LocalisationCacheBulkLoad:

Public Member Functions

 getItem ( $code, $key)
 
 getSubitem ( $code, $key, $subkey)
 
 recache ( $code)
 
 unload ( $code)
 
- Public Member Functions inherited from LocalisationCache
 __construct (ServiceOptions $options, LCStore $store, LoggerInterface $logger, array $clearStoreCallbacks, LanguageNameUtils $langNameUtils, HookContainer $hookContainer)
 For constructor parameters, \MediaWiki\MainConfigSchema::LocalisationCacheConf.
 
 disableBackend ()
 Disable the storage backend.
 
 getMessagesDirs ()
 Gets the combined list of messages dirs from core and extensions.
 
 getSubitemList ( $code, $key)
 Get the list of subitem keys for a given item.
 
 getSubitemWithSource ( $code, $key, $subkey)
 Get a subitem with its source language.
 
 isExpired ( $code)
 Returns true if the cache identified by $code is missing or expired.
 
 unloadAll ()
 Unload all data.
 

Protected Member Functions

 readPHPFile ( $fileName, $fileType)
 
 trimCache ()
 Unload cached languages until there are less than $this->maxLoadedLangs.
 

Additional Inherited Members

- Static Public Member Functions inherited from LocalisationCache
static getStoreFromConf (array $conf, $fallbackCacheDir)
 Return a suitable LCStore as specified by the given configuration.
 
- Public Attributes inherited from LocalisationCache
const ALL_ALIAS_KEYS = [ 'specialPageAliases' ]
 Keys for items which can be localized.
 
const ALL_KEYS
 All item keys.
 
const CONSTRUCTOR_OPTIONS
 
const VERSION = 5
 
- Protected Attributes inherited from LocalisationCache
array< string, array > $data = []
 The cache data.
 
array< string, array< string, array< string, string > > > $sourceLanguage = []
 The source language of cached data items.
 

Detailed Description

LocalisationCache optimised for loading many languages at once.

Used by maintenance/rebuildLocalisationCache.php.

Definition at line 28 of file LocalisationCacheBulkLoad.php.

Member Function Documentation

◆ getItem()

LocalisationCacheBulkLoad::getItem ( $code,
$key )
Parameters
string$code
string$key
Returns
mixed

Reimplemented from LocalisationCache.

Definition at line 82 of file LocalisationCacheBulkLoad.php.

◆ getSubitem()

LocalisationCacheBulkLoad::getSubitem ( $code,
$key,
$subkey )
Parameters
string$code
string$key
string$subkey
Returns
mixed

Reimplemented from LocalisationCache.

Definition at line 95 of file LocalisationCacheBulkLoad.php.

◆ readPHPFile()

LocalisationCacheBulkLoad::readPHPFile ( $fileName,
$fileType )
protected
Parameters
string$fileName
string$fileType
Returns
array|mixed

Reimplemented from LocalisationCache.

Definition at line 56 of file LocalisationCacheBulkLoad.php.

References LocalisationCache\$data.

◆ recache()

LocalisationCacheBulkLoad::recache ( $code)
Parameters
string$code

Reimplemented from LocalisationCache.

Definition at line 105 of file LocalisationCacheBulkLoad.php.

References trimCache().

◆ trimCache()

LocalisationCacheBulkLoad::trimCache ( )
protected

Unload cached languages until there are less than $this->maxLoadedLangs.

Definition at line 123 of file LocalisationCacheBulkLoad.php.

References unload(), and wfDebug().

Referenced by recache().

◆ unload()

LocalisationCacheBulkLoad::unload ( $code)
Parameters
string$code

Reimplemented from LocalisationCache.

Definition at line 115 of file LocalisationCacheBulkLoad.php.

Referenced by trimCache().


The documentation for this class was generated from the following file: