MediaWiki
1.30.2
|
This class generates message blobs for use by ResourceLoader modules. More...
Public Member Functions | |
__construct (ResourceLoader $rl=null, LoggerInterface $logger=null) | |
clear () | |
Invalidate cache keys for all known modules. More... | |
get (ResourceLoader $resourceLoader, $modules, $lang) | |
getBlob (ResourceLoaderModule $module, $lang) | |
Get the message blob for a module. More... | |
getBlobs (array $modules, $lang) | |
Get the message blobs for a set of modules. More... | |
insertMessageBlob ( $name, ResourceLoaderModule $module, $lang) | |
setLogger (LoggerInterface $logger) | |
updateMessage ( $key) | |
Invalidate cache keys for modules using this message key. More... | |
Protected Member Functions | |
fetchMessage ( $key, $lang) | |
getResourceLoader () | |
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. More... | |
makeCacheKey (ResourceLoaderModule $module, $lang) | |
Private Attributes | |
$resourceloader | |
This class generates message blobs for use by ResourceLoader modules.
A message blob is a JSON object containing the interface messages for a certain module in a certain language.
Definition at line 37 of file MessageBlobStore.php.
MessageBlobStore::__construct | ( | ResourceLoader | $rl = null , |
LoggerInterface | $logger = null |
||
) |
ResourceLoader | $rl | |
LoggerInterface | $logger |
Definition at line 56 of file MessageBlobStore.php.
References $logger, and ObjectCache\getMainWANInstance().
MessageBlobStore::clear | ( | ) |
Invalidate cache keys for all known modules.
Called by LocalisationCache after cache is regenerated.
Definition at line 189 of file MessageBlobStore.php.
|
protected |
string | $key | Message key |
string | $lang | Language code |
Definition at line 216 of file MessageBlobStore.php.
References $lang, $value, and wfMessage().
Referenced by generateMessageBlob().
|
private |
Generate the message blob for a given module in a given language.
ResourceLoaderModule | $module | |
string | $lang | Language code |
Definition at line 235 of file MessageBlobStore.php.
References $lang, $messages, as, FormatJson\encode(), fetchMessage(), ResourceLoaderModule\getMessages(), and ResourceLoaderModule\getName().
Referenced by recacheMessageBlob().
MessageBlobStore::get | ( | ResourceLoader | $resourceLoader, |
$modules, | |||
$lang | |||
) |
Definition at line 127 of file MessageBlobStore.php.
References $lang, and getBlobs().
MessageBlobStore::getBlob | ( | ResourceLoaderModule | $module, |
$lang | |||
) |
Get the message blob for a module.
ResourceLoaderModule | $module | |
string | $lang | Language code |
Definition at line 78 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 91 of file MessageBlobStore.php.
References $cache, $lang, $modules, $name, $wanCache, as, makeCacheKey(), and recacheMessageBlob().
|
protected |
Definition at line 200 of file MessageBlobStore.php.
References $resourceloader.
Referenced by updateMessage().
MessageBlobStore::insertMessageBlob | ( | $name, | |
ResourceLoaderModule | $module, | ||
$lang | |||
) |
Used to populate a cache table in the database.
Definition at line 135 of file MessageBlobStore.php.
|
private |
ResourceLoaderModule | $module | |
string | $lang |
Definition at line 145 of file MessageBlobStore.php.
References $lang, $messages, ResourceLoaderModule\getMessages(), and ResourceLoaderModule\getName().
Referenced by getBlobs().
|
protected |
string | $cacheKey | |
ResourceLoaderModule | $module | |
string | $lang |
Definition at line 160 of file MessageBlobStore.php.
References $blob, $cache, $lang, $wanCache, DB_REPLICA, generateMessageBlob(), and wfGetDB().
Referenced by getBlobs().
MessageBlobStore::setLogger | ( | LoggerInterface | $logger | ) |
LoggerInterface | $logger |
Definition at line 66 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 177 of file MessageBlobStore.php.
References as, and getResourceLoader().
|
protected |
Definition at line 45 of file MessageBlobStore.php.
Referenced by __construct(), and setLogger().
|
private |
Definition at line 40 of file MessageBlobStore.php.
Referenced by getResourceLoader().
|
protected |
Definition at line 50 of file MessageBlobStore.php.
Referenced by clear(), getBlobs(), and recacheMessageBlob().