$this->lock($cacheKey);
- # Limit the concurrency of loadFromDB to a single process
+ # Limit the concurrency of loadFromDB to a single process
# This prevents the site from going down when the cache expires
$statusKey = wfMemcKey( 'messages', $code, 'status' );
$success = $this->mMemc->add( $statusKey, 'loading', MSG_LOAD_TIMEOUT );
// Also delete cached sidebar... just in case it is affected
global $parserMemc;
- if(is_object($parserMemc)) {
- $codes = array( $code );
- if ( $code === 'en' ) {
- // Delete all sidebars, like for example on action=purge on the
- // sidebar messages
- $codes = array_keys( Language::getLanguageNames() );
- }
+ $codes = array( $code );
+ if ( $code === 'en' ) {
+ // Delete all sidebars, like for example on action=purge on the
+ // sidebar messages
+ $codes = array_keys( Language::getLanguageNames() );
+ }
- foreach ( $codes as $code ) {
- $sidebarKey = wfMemcKey( 'sidebar', $code );
- $parserMemc->delete( $sidebarKey );
- }
+ foreach ( $codes as $code ) {
+ $sidebarKey = wfMemcKey( 'sidebar', $code );
+ $parserMemc->delete( $sidebarKey );
}
wfRunHooks( "MessageCacheReplace", array( $title, $text ) );
}
# Fix whitespace
- $message = strtr( $message,
+ $message = strtr( $message,
array(
# Fix for trailing whitespace, removed by textarea
' ' => ' ',
$message = $revision->getText();
if ($this->mUseCache) {
$this->mCache[$code][$title] = ' ' . $message;
- $this->mMemc->set( $titleKey, $message, $this->mExpiry );
+ $this->mMemc->set( $titleKey, ' ' . $message, $this->mExpiry );
}
} else {
# Negative caching
function disable() { $this->mDisable = true; }
function enable() { $this->mDisable = false; }
-
+
/** @deprecated */
function disableTransform(){
wfDeprecated( __METHOD__ );