MediaWiki REL1_37
|
This class generates message blobs for use by ResourceLoader. More...
Public Member Functions | |
__construct (ResourceLoader $rl, ?LoggerInterface $logger, ?WANObjectCache $wanObjectCache) | |
clear () | |
Invalidate cache keys for all known modules. | |
getBlob (ResourceLoaderModule $module, $lang) | |
Get the message blob for a module. | |
getBlobs (array $modules, $lang) | |
Get the message blobs for a set of modules. | |
setLogger (LoggerInterface $logger) | |
updateMessage ( $key) | |
Invalidate cache keys for modules using this message key. | |
Static Public Member Functions | |
static | clearGlobalCacheEntry (WANObjectCache $cache) |
Invalidate cache keys for all known modules. | |
Protected Member Functions | |
fetchMessage ( $key, $lang) | |
recacheMessageBlob ( $cacheKey, ResourceLoaderModule $module, $lang) | |
Protected Attributes | |
LoggerInterface | $logger |
WANObjectCache | $wanCache |
Private Member Functions | |
generateMessageBlob (ResourceLoaderModule $module, $lang) | |
Generate the message blob for a given module in a given language. | |
makeCacheKey (ResourceLoaderModule $module, $lang) | |
Private Attributes | |
ResourceLoader | $resourceloader |
This class generates message blobs for use by ResourceLoader.
A message blob is a JSON object containing the interface messages for a certain module in a certain language.
Definition at line 38 of file MessageBlobStore.php.
MessageBlobStore::__construct | ( | ResourceLoader | $rl, |
?LoggerInterface | $logger, | ||
?WANObjectCache | $wanObjectCache | ||
) |
ResourceLoader | $rl | |
LoggerInterface | null | $logger | |
WANObjectCache | null | $wanObjectCache |
Definition at line 53 of file MessageBlobStore.php.
References $logger.
MessageBlobStore::clear | ( | ) |
Invalidate cache keys for all known modules.
Definition at line 178 of file MessageBlobStore.php.
|
static |
Invalidate cache keys for all known modules.
Called by LocalisationCache after cache is regenerated.
WANObjectCache | $cache |
Definition at line 189 of file MessageBlobStore.php.
References $cache.
Referenced by RebuildLocalisationCache\execute().
|
protected |
Definition at line 206 of file MessageBlobStore.php.
References $lang, and wfMessage().
|
private |
Generate the message blob for a given module in a given language.
ResourceLoaderModule | $module | |
string | $lang | Language code |
Definition at line 227 of file MessageBlobStore.php.
References $lang, ResourceLoaderModule\getMessages(), and ResourceLoaderModule\getName().
Referenced by recacheMessageBlob().
MessageBlobStore::getBlob | ( | ResourceLoaderModule | $module, |
$lang | |||
) |
Get the message blob for a module.
ResourceLoaderModule | $module | |
string | $lang | Language code |
Definition at line 84 of file MessageBlobStore.php.
References $lang, getBlobs(), and ResourceLoaderModule\getName().
MessageBlobStore::getBlobs | ( | array | $modules, |
$lang | |||
) |
Get the message blobs for a set of modules.
ResourceLoaderModule[] | $modules | Array of module objects keyed by name |
string | $lang | Language code |
Definition at line 97 of file MessageBlobStore.php.
References $cache, $lang, $modules, $wanCache, makeCacheKey(), and recacheMessageBlob().
Referenced by getBlob().
|
private |
ResourceLoaderModule | $module | |
string | $lang |
Definition at line 135 of file MessageBlobStore.php.
References $lang, ResourceLoaderModule\getMessages(), and ResourceLoaderModule\getName().
Referenced by getBlobs().
|
protected |
string | $cacheKey | |
ResourceLoaderModule | $module | |
string | $lang |
Definition at line 150 of file MessageBlobStore.php.
References $blob, $cache, $lang, $wanCache, DB_REPLICA, generateMessageBlob(), WANObjectCache\set(), and wfGetDB().
Referenced by getBlobs().
MessageBlobStore::setLogger | ( | LoggerInterface | $logger | ) |
LoggerInterface | $logger |
Definition at line 72 of file MessageBlobStore.php.
References $logger.
MessageBlobStore::updateMessage | ( | $key | ) |
Invalidate cache keys for modules using this message key.
Called by MessageCache when a message has changed.
string | $key | Message key |
Definition at line 167 of file MessageBlobStore.php.
|
protected |
Definition at line 43 of file MessageBlobStore.php.
Referenced by __construct(), and setLogger().
|
private |
Definition at line 40 of file MessageBlobStore.php.
|
protected |
Definition at line 46 of file MessageBlobStore.php.
Referenced by getBlobs(), and recacheMessageBlob().