// load() calls do try to refresh the cache with replica DB data
$this->mCache[$code]['LATEST'] = time();
// Pre-emptively update the local datacenter cache so things like edit filter and
- // blacklist changes are reflect immediately, as these often use MediaWiki: pages.
+ // blacklist changes are reflected immediately; these often use MediaWiki: pages.
// The datacenter handling replace() calls should be the same one handling edits
// as they require HTTP POST.
$this->saveToCaches( $this->mCache[$code], 'all', $code );
if ( $useDB ) {
$uckey = $wgContLang->ucfirst( $lckey );
- if ( !isset( $alreadyTried[ $langcode ] ) ) {
+ if ( !isset( $alreadyTried[$langcode] ) ) {
$message = $this->getMsgFromNamespace(
$this->getMessagePageName( $langcode, $uckey ),
$langcode
if ( $message !== false ) {
return $message;
}
- $alreadyTried[ $langcode ] = true;
+ $alreadyTried[$langcode] = true;
}
} else {
$uckey = null;
$fallbackChain = Language::getFallbacksFor( $langcode );
foreach ( $fallbackChain as $code ) {
- if ( isset( $alreadyTried[ $code ] ) ) {
+ if ( isset( $alreadyTried[$code] ) ) {
continue;
}
if ( $message !== false ) {
return $message;
}
- $alreadyTried[ $code ] = true;
+ $alreadyTried[$code] = true;
}
}
if ( isset( $this->mCache[$code][$title] ) ) {
$entry = $this->mCache[$code][$title];
if ( substr( $entry, 0, 1 ) === ' ' ) {
- // The message exists, so make sure a string is returned.
+ // The message exists and is not '!TOO BIG'
return (string)substr( $entry, 1 );
} elseif ( $entry === '!NONEXISTENT' ) {
return false;
- } elseif ( $entry === '!TOO BIG' ) {
- // Fall through and try invididual message cache below
}
+ // Fall through and try invididual message cache below
} else {
// XXX: This is not cached in process cache, should it?
$message = false;
/**
* @param string $message
* @param bool $interface
- * @param string $language Language code
+ * @param Language $language
* @param Title $title
* @return string
*/
- function transform( $message, $interface = false, $language = null, $title = null ) {
+ public function transform( $message, $interface = false, $language = null, $title = null ) {
// Avoid creating parser if nothing to transform
if ( strpos( $message, '{{' ) === false ) {
return $message;
/**
* @return Parser
*/
- function getParser() {
+ public function getParser() {
global $wgParser, $wgParserConf;
if ( !$this->mParser && isset( $wgParser ) ) {
return $res;
}
- function disable() {
+ public function disable() {
$this->mDisable = true;
}
- function enable() {
+ public function enable() {
$this->mDisable = false;
}