Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
FileBasedMessageGroupLoader Class Reference

Loads FileBasedMessageGroup, and handles the related cache. More...

Inheritance diagram for FileBasedMessageGroupLoader:
MessageGroupLoader CachedMessageGroupLoader

Public Member Functions

 __construct (MessageGroupWANCache $cache)
 
 getGroups ()
 Fetches FileBasedMessageGroups.
 
 getCacheData ()
 Generates data to be stored in the cache.
 
 recache ()
 Clear and refill the cache with the latest values.
 
 clearCache ()
 Clear values from the cache.
 
- Public Member Functions inherited from MessageGroupLoader
 isExpired (DependencyWrapper $wrapper)
 Determines if dependencies have expired.
 

Static Public Member Functions

static registerLoader (array &$groupLoader, array $deps)
 Hook: TranslateInitGroupLoaders.
 
static getInstance (WANObjectCache $cache=null)
 Return an instance of this class using the parameters, if passed, else initialize the necessary dependencies and return an instance.
 

Protected Member Functions

 clearProcessCache ()
 Clears the process cache, mainly the cached groups property.
 
 initFromCacheValue (array $cacheData)
 Initialize groups and autoload classes from the cache value.
 

Protected Attributes

 $groups
 
 $cache
 

Detailed Description

Loads FileBasedMessageGroup, and handles the related cache.

Since
2019.05

Definition at line 17 of file FileBasedMessageGroupLoader.php.

Constructor & Destructor Documentation

◆ __construct()

FileBasedMessageGroupLoader::__construct ( MessageGroupWANCache $cache)

Definition at line 31 of file FileBasedMessageGroupLoader.php.

Member Function Documentation

◆ clearCache()

FileBasedMessageGroupLoader::clearCache ( )

Clear values from the cache.

Implements CachedMessageGroupLoader.

Definition at line 147 of file FileBasedMessageGroupLoader.php.

◆ clearProcessCache()

FileBasedMessageGroupLoader::clearProcessCache ( )
protected

Clears the process cache, mainly the cached groups property.

Definition at line 155 of file FileBasedMessageGroupLoader.php.

◆ getCacheData()

FileBasedMessageGroupLoader::getCacheData ( )

Generates data to be stored in the cache.

Returns
DependencyWrapper

Definition at line 92 of file FileBasedMessageGroupLoader.php.

◆ getGroups()

FileBasedMessageGroupLoader::getGroups ( )

Fetches FileBasedMessageGroups.

Returns
MessageGroup[] Key is the MessageGroup Id and value is the corresponding FileBasedMessageGroup

Reimplemented from MessageGroupLoader.

Definition at line 49 of file FileBasedMessageGroupLoader.php.

◆ getInstance()

static FileBasedMessageGroupLoader::getInstance ( WANObjectCache $cache = null)
static

Return an instance of this class using the parameters, if passed, else initialize the necessary dependencies and return an instance.

Parameters
WANObjectCache | null$cache
Returns
self

Definition at line 79 of file FileBasedMessageGroupLoader.php.

◆ initFromCacheValue()

FileBasedMessageGroupLoader::initFromCacheValue ( array $cacheData)
protected

Initialize groups and autoload classes from the cache value.

Parameters
array$cacheData

Definition at line 164 of file FileBasedMessageGroupLoader.php.

◆ recache()

FileBasedMessageGroupLoader::recache ( )

Clear and refill the cache with the latest values.

Implements CachedMessageGroupLoader.

Definition at line 134 of file FileBasedMessageGroupLoader.php.

◆ registerLoader()

static FileBasedMessageGroupLoader::registerLoader ( array & $groupLoader,
array $deps )
static

Hook: TranslateInitGroupLoaders.

Parameters
array&$groupLoader
array$depsDependencies

Definition at line 66 of file FileBasedMessageGroupLoader.php.

Member Data Documentation

◆ $cache

FileBasedMessageGroupLoader::$cache
protected

Definition at line 29 of file FileBasedMessageGroupLoader.php.

◆ $groups

FileBasedMessageGroupLoader::$groups
protected

Definition at line 27 of file FileBasedMessageGroupLoader.php.


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