LocalisationCache_BulkLoad Class Reference

A localisation cache optimised for loading large amounts of data for many languages. More...

Inherits LocalisationCache.

List of all members.

Public Member Functions

 getItem ($code, $key)
 Get a cache item.
 getSubitem ($code, $key, $subkey)
 Get a subitem, for instance a single message for a given language.
 recache ($code)
 Load localisation data for a given language for both core and extensions and save it to the persistent cache store and the process cache.
 unload ($code)
 Unload the data for a given language from the object cache.

Public Attributes

 $fileCache = array()
 A cache of the contents of data files.
 $mruLangs = array()
 Most recently used languages.
 $maxLoadedLangs = 10
 Maximum number of languages that may be loaded into $this->data.

Protected Member Functions

 readPHPFile ($fileName, $fileType)
 Read a PHP file containing localisation data.
 trimCache ()
 Unload cached languages until there are less than $this->maxLoadedLangs.


Detailed Description

A localisation cache optimised for loading large amounts of data for many languages.

Used by rebuildLocalisationCache.php.

Definition at line 927 of file LocalisationCache.php.


Member Function Documentation

LocalisationCache_BulkLoad::getItem ( code,
key 
)

Get a cache item.

Warning: this may be slow for split items (messages), since it will need to fetch all of the subitems from the cache individually.

Reimplemented from LocalisationCache.

Definition at line 964 of file LocalisationCache.php.

References $code.

LocalisationCache_BulkLoad::getSubitem ( code,
key,
subkey 
)

Get a subitem, for instance a single message for a given language.

Reimplemented from LocalisationCache.

Definition at line 970 of file LocalisationCache.php.

References $code.

LocalisationCache_BulkLoad::readPHPFile ( _fileName,
_fileType 
) [protected]

Read a PHP file containing localisation data.

Reimplemented from LocalisationCache.

Definition at line 946 of file LocalisationCache.php.

References LocalisationCache::$data.

LocalisationCache_BulkLoad::recache ( code  ) 

Load localisation data for a given language for both core and extensions and save it to the persistent cache store and the process cache.

Reimplemented from LocalisationCache.

Definition at line 976 of file LocalisationCache.php.

References $code, and trimCache().

LocalisationCache_BulkLoad::trimCache (  )  [protected]

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

Definition at line 991 of file LocalisationCache.php.

References $code, unload(), and wfDebug().

Referenced by recache().

LocalisationCache_BulkLoad::unload ( code  ) 

Unload the data for a given language from the object cache.

Reduces memory usage.

Reimplemented from LocalisationCache.

Definition at line 983 of file LocalisationCache.php.

References $code.

Referenced by trimCache().


Member Data Documentation

LocalisationCache_BulkLoad::$fileCache = array()

A cache of the contents of data files.

Core files are serialized to avoid using ~1GB of RAM during a recache.

Definition at line 932 of file LocalisationCache.php.

LocalisationCache_BulkLoad::$maxLoadedLangs = 10

Maximum number of languages that may be loaded into $this->data.

Definition at line 944 of file LocalisationCache.php.

LocalisationCache_BulkLoad::$mruLangs = array()

Most recently used languages.

Uses the linked-list aspect of PHP hashtables to keep the most recently used language codes at the end of the array, and the language codes that are ready to be deleted at the beginning.

Definition at line 939 of file LocalisationCache.php.


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

Generated on Sat Apr 30 22:57:42 2011 for MediaWiki by  doxygen 1.5.9