Followup r78924: keep track of exception/warning comments separately, to prevent...
[lhc/web/wiklou.git] / includes / BacklinkCache.php
index cdf82f9..02b0f17 100644 (file)
@@ -21,6 +21,14 @@ class BacklinkCache {
                $this->title = $title;
        }
 
+       /**
+        * Serialization handler, diasallows to serialize the database to prevent
+        * failures after this class is deserialized from cache with dead DB connection.
+        */
+       function __sleep() {
+               return array( 'partitionCache', 'fullResultCache', 'title' );
+       }
+
        /**
         * Clear locally stored data
         */
@@ -208,7 +216,6 @@ class BacklinkCache {
 
                // Try memcached
                global $wgMemc;
-               global $wgContLang;
 
                $memcKey = wfMemcKey(
                        'backlinks',
@@ -217,9 +224,6 @@ class BacklinkCache {
                        $batchSize
                );
 
-               if ( $wgContLang === null ) $wgContLang = new Language;
-               if ( $wgMemc === null ) $wgMemc =& wfGetMainCache();
-
                $memcValue = $wgMemc->get( $memcKey );
 
                if ( is_array( $memcValue ) ) {