28 define(
'MSG_CACHE_VERSION', 2 );
101 if ( self::$instance === null ) {
103 self::$instance =
new self(
110 return self::$instance;
119 self::$instance = null;
130 $lckey = strtr(
$key,
' ',
'_' );
131 if ( ord( $lckey ) < 128 ) {
132 $lckey[0] = strtolower( $lckey[0] );
134 $lckey = $wgContLang->lcfirst( $lckey );
152 $this->mMemc = $memCached;
153 $this->mDisable = !$useDB;
154 $this->mExpiry = $expiry;
156 if ( $wgUseLocalMessageCache ) {
173 if ( !$this->mParserOptions ) {
174 if ( !$wgUser->isSafeToLoad() ) {
179 $po->setEditSection(
false );
180 $po->setAllowUnsafeRawHtml(
false );
189 $this->mParserOptions->setAllowUnsafeRawHtml(
false );
204 return $this->localCache->get( $cacheKey );
215 $this->localCache->set( $cacheKey,
$cache );
240 if ( !is_string(
$code ) ) {
241 # This isn't really nice, so at least make a note about it and try to
243 wfDebug( __METHOD__ .
" called without providing a language code\n" );
247 # Don't do double loading...
248 if ( isset( $this->mLoadedLanguages[
$code] ) && $mode != self::FOR_UPDATE ) {
252 # 8 lines of code just to say (once) that message cache is disabled
253 if ( $this->mDisable ) {
254 static $shownDisabled =
false;
255 if ( !$shownDisabled ) {
256 wfDebug( __METHOD__ .
": disabled\n" );
257 $shownDisabled =
true;
263 # Loading code starts
265 $staleCache =
false; # a
cache array with expired
data,
or false if none has been loaded
266 $where = []; # Debug info, delayed to avoid spamming debug log
too much
268 # Hash of the contents is stored in memcache, to detect if data-center cache
269 # or local cache goes out of date (e.g. due to replace() on some other server)
272 # Try the local cache and check against the cluster hash key...
275 $where[] =
'local cache is empty';
276 } elseif ( !isset(
$cache[
'HASH'] ) ||
$cache[
'HASH'] !== $hash ) {
277 $where[] =
'local cache has the wrong hash';
280 $where[] =
'local cache is expired';
282 } elseif ( $hashVolatile ) {
283 $where[] =
'local cache validation key is expired/volatile';
286 $where[] =
'got from local cache';
293 # Try the global cache. If it is empty, try to acquire a lock. If
294 # the lock can't be acquired, wait for the other thread to finish
295 # and then try the global cache a second time.
296 for ( $failedAttempts = 0; $failedAttempts <= 1; $failedAttempts++ ) {
297 if ( $hashVolatile && $staleCache ) {
298 # Do not bother fetching the whole cache blob to avoid I/O.
299 # Instead, just try to get the non-blocking $statusKey lock
300 # below, and use the local stale value if it was not acquired.
301 $where[] =
'global cache is presumed expired';
303 $cache = $this->mMemc->get( $cacheKey );
305 $where[] =
'global cache is empty';
307 $where[] =
'global cache is expired';
309 } elseif ( $hashVolatile ) {
310 # DB results are slave lag prone until the holdoff TTL passes.
311 # By then, updates should be reflected in loadFromDBWithLock().
312 # One thread renerates the cache while others use old values.
313 $where[] =
'global cache is expired/volatile';
316 $where[] =
'got from global cache';
324 # Done, no need to retry
328 # We need to call loadFromDB. Limit the concurrency to one process.
329 # This prevents the site from going down when the cache expires.
330 # Note that the DB slam protection lock here is non-blocking.
332 if ( $loadStatus ===
true ) {
335 } elseif ( $staleCache ) {
336 # Use the stale cache while some other thread constructs the new one
337 $where[] =
'using stale cache';
338 $this->mCache[
$code] = $staleCache;
341 } elseif ( $failedAttempts > 0 ) {
342 # Already blocked once, so avoid another lock/unlock cycle.
343 # This case will typically be hit if memcached is down, or if
344 # loadFromDB() takes longer than LOCK_WAIT.
345 $where[] =
"could not acquire status key.";
347 } elseif ( $loadStatus ===
'cantacquire' ) {
348 # Wait for the other thread to finish, then retry. Normally,
349 # the memcached get() will then yeild the other thread's result.
350 $where[] =
'waited for other thread to complete';
353 # Disable cache; $loadStatus is 'disabled'
360 $where[] =
'loading FAILED - cache is disabled';
361 $this->mDisable =
true;
362 $this->mCache =
false;
363 wfDebugLog(
'MessageCacheError', __METHOD__ .
": Failed to load $code\n" );
364 # This used to throw an exception, but that led to nasty side effects like
365 # the whole wiki being instantly down if the memcached server died
367 # All good, just record the success
368 $this->mLoadedLanguages[
$code] =
true;
371 $info = implode(
', ', $where );
372 wfDebugLog(
'MessageCache', __METHOD__ .
": Loading $code... $info\n" );
386 # If cache updates on all levels fail, give up on message overrides.
387 # This is to avoid easy site outages; see $saveSuccess comments below.
389 $status = $this->mMemc->get( $statusKey );
391 $where[] =
"could not load; method is still globally disabled";
395 # Now let's regenerate
396 $where[] =
'loading from database';
398 # Lock the cache to prevent conflicting writes.
399 # This lock is non-blocking so stale cache can quickly be used.
400 # Note that load() will call a blocking getReentrantScopedLock()
401 # after this if it really need to wait for any current thread.
404 if ( !$scopedLock ) {
405 $where[] =
'could not acquire main lock';
406 return 'cantacquire';
413 if ( !$saveSuccess ) {
427 if ( !$wgUseLocalMessageCache ) {
428 $this->mMemc->set( $statusKey,
'error', 60 * 5 );
429 $where[] =
'could not save cache, disabled globally for 5 minutes';
431 $where[] =
"could not save global cache";
456 'page_is_redirect' => 0,
461 if ( $wgAdaptiveMessageCache &&
$code !== $wgLanguageCode ) {
462 if ( !isset( $this->mCache[$wgLanguageCode] ) ) {
463 $this->
load( $wgLanguageCode );
465 $mostused = array_keys( $this->mCache[$wgLanguageCode] );
467 $mostused[
$key] =
"$value/$code";
471 if ( count( $mostused ) ) {
472 $conds[
'page_title'] = $mostused;
473 } elseif (
$code !== $wgLanguageCode ) {
474 $conds[] =
'page_title' .
$dbr->buildLike(
$dbr->anyString(),
'/',
$code );
476 # Effectively disallows use of '/' character in NS_MEDIAWIKI for uses
477 # other than language code.
478 $conds[] =
'page_title NOT' .
$dbr->buildLike(
$dbr->anyString(),
'/',
$dbr->anyString() );
481 # Conditions to fetch oversized pages to ignore them
483 $bigConds[] =
'page_len > ' . intval( $wgMaxMsgCacheEntrySize );
485 # Load titles for all oversized pages in the MediaWiki namespace
486 $res =
$dbr->select(
'page',
'page_title', $bigConds, __METHOD__ .
"($code)-big" );
487 foreach (
$res as $row ) {
488 $cache[$row->page_title] =
'!TOO BIG';
491 # Conditions to load the remaining pages with their contents
492 $smallConds = $conds;
493 $smallConds[] =
'page_latest=rev_id';
494 $smallConds[] =
'rev_text_id=old_id';
495 $smallConds[] =
'page_len <= ' . intval( $wgMaxMsgCacheEntrySize );
498 [
'page',
'revision',
'text' ],
499 [
'page_title',
'old_text',
'old_flags' ],
501 __METHOD__ .
"($code)-small"
504 foreach (
$res as $row ) {
506 if ( $text ===
false ) {
513 .
": failed to load message page text for {$row->page_title} ($code)"
516 $entry =
' ' . $text;
518 $cache[$row->page_title] = $entry;
538 if ( $this->mDisable ) {
543 if ( strpos(
$title,
'/' ) !==
false &&
$code === $wgLanguageCode ) {
558 if ( $text ===
false ) {
561 $this->wanCache->delete( $titleKey );
562 } elseif ( strlen( $text ) > $wgMaxMsgCacheEntrySize ) {
565 $this->wanCache->set( $titleKey,
' ' . $text, $this->mExpiry );
568 $this->wanCache->delete( $titleKey );
573 $this->mCache[
$code][
'LATEST'] = time();
586 if (
$code ===
'en' ) {
593 $sidebarKey =
wfMemcKey(
'sidebar', $code );
594 $this->wanCache->delete( $sidebarKey );
599 $blobStore = $resourceloader->getMessageBlobStore();
600 $blobStore->updateMessage( $wgContLang->lcfirst( $msg ) );
612 if ( !isset(
$cache[
'VERSION'] ) || !isset(
$cache[
'EXPIRY'] ) ) {
635 if ( $dest ===
'all' ) {
637 $success = $this->mMemc->set( $cacheKey, $cache );
656 $value = $this->wanCache->get(
673 $expired = ( $curTTL < 0 );
677 return [ $hash, $expired ];
690 $this->wanCache->set(
693 'hash' => $cache[
'HASH'],
694 'latest' => isset( $cache[
'LATEST'] ) ? $cache[
'LATEST'] : 0
706 return $this->mMemc->getScopedLock(
$key, $timeout, self::LOCK_TTL, __METHOD__ );
743 function get(
$key, $useDB =
true, $langcode =
true, $isFullKey =
false ) {
744 if ( is_int(
$key ) ) {
748 } elseif ( !is_string(
$key ) ) {
750 } elseif (
$key ===
'' ) {
756 $pos = strrpos(
$key,
'/' );
757 if ( $isFullKey && $pos !==
false ) {
758 $langcode = substr(
$key, $pos + 1 );
765 Hooks::run(
'MessageCache::get', [ &$lckey ] );
772 !$this->mDisable && $useDB
776 if ( $message ===
false ) {
777 $parts = explode(
'/', $lckey );
781 if ( count( $parts ) == 2 && $parts[1] !==
'' ) {
783 if ( $message === null ) {
790 if ( $message !==
false ) {
792 $message = str_replace(
794 # Fix
for trailing whitespace, removed
by textarea
796 # Fix
for NBSP, converted to space
by firefox
833 if ( $message !==
false ) {
838 $message = $this->
getMessageForLang( $wgContLang, $lckey, $useDB, $alreadyTried );
854 $langcode =
$lang->getCode();
858 $uckey = $wgContLang->ucfirst( $lckey );
860 if ( !isset( $alreadyTried[ $langcode ] ) ) {
866 if ( $message !==
false ) {
869 $alreadyTried[ $langcode ] =
true;
874 $message =
$lang->getMessage( $lckey );
875 if ( $message !== null ) {
883 foreach ( $fallbackChain
as $code ) {
884 if ( isset( $alreadyTried[ $code ] ) ) {
890 if ( $message !==
false ) {
893 $alreadyTried[
$code ] =
true;
909 if ( $langcode === $wgLanguageCode ) {
913 return "$uckey/$langcode";
933 if ( substr( $entry, 0, 1 ) ===
' ' ) {
936 return (
string)substr( $entry, 1 );
937 } elseif ( $entry ===
'!NONEXISTENT' ) {
939 } elseif ( $entry ===
'!TOO BIG' ) {
945 Hooks::run(
'MessagesPreLoad', [ $title, &$message ] );
946 if ( $message !==
false ) {
953 # Try the individual message cache
954 $titleKey =
wfMemcKey(
'messages',
'individual', $title );
955 $entry = $this->wanCache->get( $titleKey );
957 if ( substr( $entry, 0, 1 ) ===
' ' ) {
962 return (
string)substr( $entry, 1 );
963 } elseif ( $entry ===
'!NONEXISTENT' ) {
968 # Corrupt/obsolete entry, delete it
969 $this->wanCache->delete( $titleKey );
973 # Try loading it from the database
981 __METHOD__ .
": failed to load message page text for {$title} ($code)"
989 $message =
$content->getWikitextForTransclusion();
991 if ( $message ===
false || $message === null ) {
994 __METHOD__ .
": message content doesn't provide wikitext "
995 .
"(content model: " .
$content->getModel() .
")"
1001 $this->wanCache->set( $titleKey,
' ' . $message, $this->mExpiry );
1008 if ( $message ===
false ) {
1010 $this->wanCache->set( $titleKey,
'!NONEXISTENT', $this->mExpiry );
1025 if ( strpos( $message,
'{{' ) ===
false ) {
1029 if ( $this->mInParser ) {
1036 $popts->setInterfaceMessage( $interface );
1037 $popts->setTargetLanguage( $language );
1039 $userlang = $popts->setUserLang( $language );
1040 $this->mInParser =
true;
1041 $message =
$parser->transformMsg( $message, $popts,
$title );
1042 $this->mInParser =
false;
1043 $popts->setUserLang( $userlang );
1054 if ( !$this->mParser && isset( $wgParser ) ) {
1055 # Do some initialisation so that we don't have to do it twice
1056 $wgParser->firstCallInit();
1057 # Clone it and store it
1058 $class = $wgParserConf[
'class'];
1059 if ( $class ==
'ParserDiffTest' ) {
1061 $this->mParser =
new $class( $wgParserConf );
1079 $interface =
false, $language = null
1081 if ( $this->mInParser ) {
1082 return htmlspecialchars( $text );
1087 $popts->setInterfaceMessage( $interface );
1089 if ( is_string( $language ) ) {
1092 $popts->setTargetLanguage( $language );
1096 wfDebugLog(
'GlobalTitleFail', __METHOD__ .
' called by ' .
1102 # It's not uncommon having a null $wgTitle in scripts. See r80898
1103 # Create a ghost title in such case
1107 $this->mInParser =
true;
1109 $this->mInParser =
false;
1115 $this->mDisable =
true;
1119 $this->mDisable =
false;
1143 foreach ( array_keys( $langs )
as $code ) {
1144 # Global and local caches
1145 $this->wanCache->touchCheckKey(
wfMemcKey(
'messages', $code ) );
1148 $this->mLoadedLanguages = [];
1158 $pieces = explode(
'/',
$key );
1159 if ( count( $pieces ) < 2 ) {
1163 $lang = array_pop( $pieces );
1168 $message = implode(
'/', $pieces );
1170 return [ $message,
$lang ];
1184 if ( !isset( $this->mCache[
$code] ) ) {
1190 unset(
$cache[
'VERSION'] );
1191 unset(
$cache[
'EXPIRY'] );
1196 return array_map( [ $wgContLang,
'lcfirst' ], array_keys(
$cache ) );
saveToCaches(array $cache, $dest, $code=false)
Shortcut to update caches.
and how to run hooks for an and one after Each event has a preferably in CamelCase For ArticleDelete hook A clump of code and data that should be run when an event happens This can be either a function and a chunk of data
static getMainWANInstance()
Get the main WAN cache object.
getMessageFromFallbackChain($lang, $lckey, $useDB)
Given a language, try and fetch messages from that language.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
const MSG_CACHE_VERSION
MediaWiki message cache structure version.
the array() calling protocol came about after MediaWiki 1.4rc1.
static getRevisionText($row, $prefix= 'old_', $wiki=false)
Get revision text associated with an old or archive row $row is usually an object from wfFetchRow()...
I won t presume to tell you how to I m just describing the methods I chose to use for myself If you do choose to follow these it will probably be easier for you to collaborate with others on the but if you want to contribute without by all means do which work well I also use K &R brace matching style I know that s a religious issue for so if you want to use a style that puts opening braces on the next that s OK too
magic word the default is to use $key to get the and $key value or $key value text $key value html to format the value $key
load($code=false, $mode=null)
Loads messages from caches or from database in this order: (1) local message cache (if $wgUseLocalMes...
isCacheExpired($cache)
Is the given cache array expired due to time passing or a version change?
static getMessageFor($key, $code)
Get a message for a given language.
Set options of the Parser.
globals txt Globals are evil The original MediaWiki code relied on globals for processing context far too often MediaWiki development since then has been a story of slowly moving context out of global variables and into objects Storing processing context in object member variables allows those objects to be reused in a much more flexible way Consider the elegance of
database rows
if(!isset($args[0])) $lang
processing should stop and the error should be shown to the user * false
static destroyInstance()
Destroy the singleton instance.
null for the local wiki Added in
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
Represents a title within MediaWiki.
when a variable name is used in a it is silently declared as a new local masking the global
static getFallbacksFor($code)
Get the ordered list of fallback languages.
static newFromTitle(LinkTarget $linkTarget, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given link target...
wfGetMessageCacheStorage()
Get the cache object used by the message cache.
Message cache Performs various MediaWiki namespace-related functions.
transform($message, $interface=false, $language=null, $title=null)
$wgUseLocalMessageCache
Set this to true to maintain a copy of the message cache on the local server.
getMsgFromNamespace($title, $code)
Get a message from the MediaWiki namespace, with caching.
wfDebug($text, $dest= 'all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
static fetchLanguageNames($inLanguage=null, $include= 'mw')
Get an array of language names, indexed by code.
getParserOptions()
ParserOptions is lazy initialised.
getLocalCache($code)
Try to load the cache from APC.
you have access to all of the normal MediaWiki so you can get a DB use the cache
wfTimestamp($outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
static normalizeKey($key)
Normalize message key input.
$wgLanguageCode
Site language code.
wfDebugLog($logGroup, $text, $dest= 'all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not...
saveToLocalCache($code, $cache)
Save the cache to APC.
$wgMaxMsgCacheEntrySize
Maximum entry size in the message cache, in bytes.
static getMain()
Static methods.
wfGetCache($cacheType)
Get a specific cache object.
$wgAdaptiveMessageCache
Instead of caching everything, only cache those messages which have been customised in the site conte...
$wgUseDatabaseMessages
Translation using MediaWiki: namespace.
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
$mParserOptions
Message cache has its own parser which it uses to transform messages.
$mLoadedLanguages
Variable for tracking which variables are already loaded.
namespace and then decline to actually register it file or subcat img or subcat $title
static $instance
Singleton instance.
getAllMessageKeys($code)
Get all message keys stored in the message cache for a given language.
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
getValidationHash($code)
Get the md5 used to validate the local APC cache.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable or merely the Work and Derivative Works thereof Contribution shall mean any work of including the original version of the Work and any modifications or additions to that Work or Derivative Works that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner For the purposes of this submitted means any form of or written communication sent to the Licensor or its including but not limited to communication on electronic mailing source code control and issue tracking systems that are managed by
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
static fetchLanguageName($code, $inLanguage=null, $include= 'all')
static newFromAnon()
Get a ParserOptions object for an anonymous user.
__construct($memCached, $useDB, $expiry)
const WAIT_SEC
How long to wait for memcached locks.
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
const HOLDOFF_TTL
Seconds to tombstone keys on delete()
wfGetAllCallers($limit=3)
Return a string consisting of callers in the stack.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object to manipulate or replace but no entry for that model exists in $wgContentHandlers if desired whether it is OK to use $contentModel on $title Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok inclusive false for true for descending in case the handler function wants to provide a converted Content object Note that $result getContentModel() must return $toModel. 'CustomEditor'you ll need to handle error messages
isDisabled()
Whether DB/cache usage is disabled for determining messages.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
$mExpiry
Lifetime for cache, used by object caching.
parse($text, $title=null, $linestart=true, $interface=false, $language=null)
static getLocalServerInstance($fallback=CACHE_NONE)
Factory function for CACHE_ACCEL (referenced from DefaultSettings.php)
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content $content
$wgMsgCacheExpiry
Expiry time for the message cache key.
$mCache
Process local cache of loaded messages that are defined in MediaWiki namespace.
loadFromDBWithLock($code, array &$where, $mode=null)
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
getReentrantScopedLock($key, $timeout=self::WAIT_SEC)
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
static consume(ScopedCallback &$sc=null)
Trigger a scoped callback and destroy it.
loadFromDB($code, $mode=null)
Loads cacheable messages from the database.
clear()
Clear all stored messages.
setValidationHash($code, array $cache)
Set the md5 used to validate the local disk cache.
wfMemcKey()
Make a cache key for the local wiki.
if(!$wgRequest->checkUrlExtension()) if(!$wgEnableAPI) $wgTitle
$mDisable
Should mean that database cannot be used, but check.
static factory($code)
Get a cached or new language object for a given language code.
getMessageForLang($lang, $lckey, $useDB, &$alreadyTried)
Given a language, try and fetch messages from that language and its fallbacks.
const LOCK_TTL
How long memcached locks last.
static & makeTitle($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
static singleton()
Get the signleton instance of this class.
replace($title, $text)
Updates cache as necessary when message page is changed.
getMessagePageName($langcode, $uckey)
Get the message page name for a given language.
wfGetLangObj($langcode=false)
Return a Language object from $langcode.