# Hash of the contents is stored in memcache, to detect if local cache goes
# out of date (e.g. due to replace() on some other server)
if ( $wgUseLocalMessageCache ) {
- wfProfileIn( __METHOD__ . '-fromlocal' );
$hash = $this->mMemc->get( wfMemcKey( 'messages', $code, 'hash' ) );
if ( $hash ) {
$this->mCache[$code] = $cache;
}
}
- wfProfileOut( __METHOD__ . '-fromlocal' );
}
if ( !$success ) {
# the lock can't be acquired, wait for the other thread to finish
# and then try the global cache a second time.
for ( $failedAttempts = 0; $failedAttempts < 2; $failedAttempts++ ) {
- wfProfileIn( __METHOD__ . '-fromcache' );
$cache = $this->mMemc->get( $cacheKey );
if ( !$cache ) {
$where[] = 'global cache is empty';
$success = true;
}
- wfProfileOut( __METHOD__ . '-fromcache' );
-
if ( $success ) {
# Done, no need to retry
break;
$this->saveToLocal( $serialized, $hash, $code );
}
-
return $success;
}
function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) {
global $wgContLang;
-
if ( is_int( $key ) ) {
// Fix numerical strings that somehow become ints
// on their way here
$res = $parser->parse( $text, $title, $popts, $linestart );
$this->mInParser = false;
-
return $res;
}