Decomment parts accidentally commited commented in r62557
[lhc/web/wiklou.git] / includes / MessageCache.php
index 62f0813..2c53430 100644 (file)
@@ -256,7 +256,7 @@ class MessageCache {
 
                        $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 );
@@ -399,18 +399,16 @@ class MessageCache {
 
                // 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 ) );
@@ -564,7 +562,7 @@ class MessageCache {
                }
 
                # Fix whitespace
-               $message = strtr( $message, 
+               $message = strtr( $message,
                        array(
                                # Fix for trailing whitespace, removed by textarea
                                ' ' => ' ',
@@ -637,7 +635,7 @@ class MessageCache {
                        $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
@@ -679,7 +677,7 @@ class MessageCache {
 
        function disable() { $this->mDisable = true; }
        function enable() { $this->mDisable = false; }
+
        /** @deprecated */
        function disableTransform(){
                wfDeprecated( __METHOD__ );